docker-compose up -d --no-deps --build <service_name>
--no-deps --Do not start other associated services
--build --Build before starting the container
version: "3.3"
services:
app:
container_name: "my-app"
Note that <service_name>
is the service name in docker-compose.yml, not the container name.
In the above example, it would be app instead of my-app.
I only want to rebuild and start one container, but every time docker-compose down && docker-compose build && docker-compose up -d
It was the content that I thought I wish I could do it in a shorter time.
https://stackoverflow.com/questions/36884991/how-to-rebuild-docker-container-in-docker-compose-yml
Recommended Posts