Skip to content

Instantly share code, notes, and snippets.

@wegry
Created July 27, 2018 11:34
Show Gist options
  • Save wegry/fb6702c8ead9fb97c4746a8564f3dd59 to your computer and use it in GitHub Desktop.
Save wegry/fb6702c8ead9fb97c4746a8564f3dd59 to your computer and use it in GitHub Desktop.
Rebuild and restart specific docker-compose containers without restarting docker-compose entirely
rebuild_restart () {
if [ -n "$1" ]
then
echo "Rebuilding and restarting $@"
docker-compose up --build --no-deps -d "$@"
else
echo "You need a container name (e.g. rebuild_restart my-container other-container)"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment