docker-compose Rebuild and start Only one container

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.

reference

https://stackoverflow.com/questions/36884991/how-to-rebuild-docker-container-in-docker-compose-yml

Recommended Posts

docker-compose Rebuild and start Only one container
Container does not start with docker-compose
Recreate the container and then start it
The story when the container does not start up with docker-compose up and an error occurs
Automatically start the container
Start k3s with docker-compose
docker-compose down and stop