Disable autostart of docker-compose project

后端 未结 4 2167
青春惊慌失措
青春惊慌失措 2021-02-06 21:11

I have a docker-compose project using Docker for Mac that autostarts when I boot the computer.

I usually start the project with docker-compose up -d, but ev

4条回答
  •  Happy的楠姐
    2021-02-06 21:41

    Beside setting restart: unless-stopped, remove existing containers and recreate them.

    docker-compose down
    docker-compose up -d
    

    Now, it would work as expected:

    docker-compose stop
    sudo service docker restart
    docker-compose ps
    # should NOT HAVE containers running
    
    docker-compose up -d
    sudo service docker restart
    docker-compose ps
    # should HAVE containers running
    

提交回复
热议问题