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 run the following commands:
docker-compose up -d # run all services
docker-compose stop nginx # stop only one. but it still running !!!
docker-compose build --no-cache nginx
docker-compose up -d --no-deps # link nginx to other services
At the end i got old nginx container. By the way docker-compose doesn't kill all running containers !
docker-compose up --build
- Jinna Baludocker-compose up --build
rebuild all containers. Usedocker-compose up --build <service_name>
as stated in @denov comment. - Jsowadocker-compose up --build <service_name>
does not work if you have a docker-compose.yml with containers coming from a container-registry - chillwalkerdocker-compose build --no-cache
when you want to build from the first level. - hassanzadeh.sd