How to rebuild docker container in docker-compose.yml?

前端 未结 10 2020
闹比i
闹比i 2021-01-29 17:14

There are scope of services which defined in docker-compose.yml. These service have been started. I need to rebuild only one of these and start it without up other services. I r

10条回答
  •  情歌与酒
    2021-01-29 18:00

    docker-compose stop nginx # stop if running
    docker-compose rm -f nginx # remove without confirmation
    docker-compose build nginx # build
    docker-compose up -d nginx # create and start in background
    

    Removing container with rm is essential. Without removing, Docker will start old container.

提交回复
热议问题