Quick Update Docker Containers

I run a home docker server, for the most part it was a “set it and forget” sort of setup. Occasionally I update the docker images and always have to remind myself of the steps involved as I don’t do it often enough. I built my initial docker setup following most of this guide.

Here are the steps I take to update my docker images and Ubuntu server.

  1. Sudo apt-get update
    1. Always a good idea to install server updates first.
  2. Docker-compose -f ~/docker/docker-compose.yml down
    1. You need to run this command from the folder where your docker compose file is located. This will force a shutdown of all of your docker containers included in your compose file.
  3. Docker-compose pull
    1. This command will pull down the new docker container images from your compose repository.
  4. Docker-compose -f ~/docker/docker-compose.yml up
    1. This command forces all of your docker container images to start up again.
  5. Check on the status of your docker containers by running docker ps -a.
  6. Restart your server, if necessary, with the shutdown -r command.
Shut down your docker containers first.
Pull new images for your containers.
Bring your containers back up.
Lastly check the status and make sure that your new images you pulled are up and running.

Leave a Comment