To update a docker container, or multiple docker containers, using a Compose file:

$ sudo docker compose pull
$ sudo docker compose up -d --force-recreate --build

Note that if you’re using a compose file not called compose.yaml, you’ll need to specify that on the first two commands, between compose and pull add -f <filename>.

Docker Registry Proxies

If you use a local proxy like docker-registry-proxy, you may end up pulling proxy-cached images instead of the actual latest from upstream. If needed, clear the proxy cache before updating (see Clearing the cache).

See also