Programing

docker-compose start“오류 : 시작할 컨테이너가 없습니다.”

lottogame 2020. 10. 27. 07:46
반응형

docker-compose start“오류 : 시작할 컨테이너가 없습니다.”


Docker 컨테이너 그룹을 시작하기 위해 Docker Compose (Windows의 Docker Machine 포함)를 사용하려고합니다.

내 docker-compose.yml :

version: '2'
services:
  postgres:
    build: ./postgres
    environment:
      - POSTGRES_PASSWORD=mysecretpassword
  frontend:
    build: ./frontend
    ports:
      - "4567:4567"
    depends_on:
      - postgres
  backend:
    build: ./backend
    ports:
       - "5000:5000"
    depends_on:
       - postgres

docker-compose build성공적으로 실행됩니다. 실행 docker-compose start하면 다음 출력이 표시됩니다.

Starting postgres ... done
Starting frontend ... done
Starting backend ... done
ERROR: No containers to start

도커 컨테이너가 실행되고 있지 않음을 확인했습니다. 컨테이너를 시작하려면 어떻게해야합니까?


여기서 문제는 컨테이너를 만들지 않았다는 것입니다. 이러한 컨테이너를 실행하기 전에 생성해야합니다. 대신를 사용할 수 있습니다. 그러면 docker-compose up컨테이너가 생성되고 시작됩니다.

docker-compose create컨테이너를 생성하기 위해 먼저 명령 을 실행 한 다음 docker-compose start.


오류를 본 이유는이다 docker-compose startdocker-compose restart컨테이너가 이미 존재한다고 가정합니다.

컨테이너를 빌드하고 시작하려면

docker-compose up

컨테이너 만 빌드하려면

docker-compose up --no-start

나중에 docker-compose {start,restart,stop}예상대로 작동합니다.

저기에 의해 사용되지 docker-compose create명령 만 더 찬성되지 않습니다 docker-compose up --no-start.

참고 URL : https://stackoverflow.com/questions/39562748/docker-compose-start-error-no-containers-to-start

반응형