docker-compose smart use

Generally do ctf questions, sometimes the questions are given to
docker

docker-compose up --build -d

-d means to enter the background after running the results. This command not only helps us build the image, but also helps us run a container

docker-compose build

This command only helps us build image
and there is another command

docker-compose up --force-recreate -d

Sometimes we may not want to rebuild images, but if we want to rebuild a container, we can use this command to
see the picture below. After I run this command, the container id changes, indicating that it is a new container, and what we do at the same time is to kill the old one. image, run new containers without worrying about subsequent cleanup
insert image description here

Guess you like

Origin blog.csdn.net/azraelxuemo/article/details/128276876