Skip to content

Docker compose 설정 변경 미반영 문제 #147

@ckdals4600

Description

@ckdals4600

버그 내용

docker compose config 명령어로 설정을 확인했을 때, 수정된 파일 내용이 반영되지 않고 구버전 설정이 출력되는 현상이 발생함.

1. 현상

  • 설정 불일치: docker compose config 실행 결과와 실제 파일(cat 조회) 내용이 서로 다름.
  • Config 출력 값:
    • 이미지: teamsofa/linkiving-core:latest (구버전)
    • 포트 설정: 구버전 포트 매핑 유지됨.
  • 실제 파일 내용:
    • 이미지: linkivingsofa/core:latest (신규)
    • 추가 설정: Healthcheck, Logging 설정이 포함되어 있음.

버그 재현 방법

  • sudo docker compose config
name: ubuntu
services:
  blue:
    container_name: blue
    environment:
      LANG: ko_KR.UTF-8
      SPRING_PROFILES_ACTIVE: dev
    image: teamsofa/linkiving-core:latest
    networks:
      default: null
    ports:
      - mode: ingress
        target: 8080
        published: "8080"
        protocol: tcp
  green:
    container_name: green
    environment:
      LANG: ko_KR.UTF-8
      SPRING_PROFILES_ACTIVE: dev
    image: teamsofa/linkiving-core:latest
    networks:
      default: null
    ports:
      - mode: ingress
        target: 8080
        published: "8081"
        protocol: tcp
networks:
  default:
    name: ubuntu_default
  • cat ./docker/docker-compose.yml
# docker-compose.yml
version: '3.8'

services:
  blue:
    image: linkivingsofa/core:latest
    container_name: blue
    environment:
      - LANG=ko_KR.UTF-8
      - TZ=Asia/Seoul
    ports:
      - '8080:8080'
    healthcheck:
      test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    restart: unless-stopped
    networks:
      - app-network
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

  green:
    image: linkivingsofa/core:latest
    container_name: green
    environment:
      - LANG=ko_KR.UTF-8
      - TZ=Asia/Seoul
    ports:
      - '8081:8080'
    healthcheck:
      test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    restart: unless-stopped
    networks:
      - app-network
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

networks:
  app-network:
    driver: bridge

참고 자료

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions