Rebuilding single services in docker-compose

Note to self: a single service (“container”) out of a docker-compose.yaml file is rebuilt and restarted like this:

docker-compose build
docker-compose up -d  # runs containers, but returns immediately
# Oops, something needs to be changed
docker-compose stop web
# Make changes
docker-compose build web
docker-compose up -d --no-recreate web

As Daniel Nephin writes here: https://github.com/docker/compose/issues/1195#issuecomment-86670031

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s