Here's what it looks like using docker-compose
when building a custom Dockerfile
.
docker build -t imagename:version .
This will store your new version locally.docker-compose down
docker-compose.yml
file to reflect the new image name you set at step 1.docker-compose up -d
. It will look locally for the image and use your upgraded one.-EDIT-
My steps above are more verbose than they need to be. I've optimized my workflow by including the build: .
parameter to my docker-compose file. The steps looks this now:
docker-compose build
docker-compose up -d
I didn't realize at the time, but docker-compose is smart enough to simply update my container to the new image with the one command, instead of having to bring it down first.