Upgrade beyond Docker 1.12 on CentOS 7

If you’ve a CentOS 7 server, you probably picked at first Docker from a specialized CBS from Project Atomic, “virt7”, or from EPEL.

It’s been a while Docker 1.13 has been released. Yet, there isn’t any upgrade beyond 1.12 (but fixes backported to this 1.12 branch).

You need to get rid of the old packages, then install a specific repository (community docker-ce or your subscription docker-ee one) and a new docker-ce/docker-ee package. The procedure is described at https://docs.docker.com/engine/installation/linux/centos/. A Salt state for that is provided below.

During this upgrade, your containers will be still running, the Docker engine now being able to pick up resources already launched and containerized and manage them.

Upgrade from an old Docker version prior to 1.10

The image data format has been changed.

Anytime it’s convenient, destroy and recreate every containers. For the few containers you can’t, use the migration tool to minimize downtime. If you don’t, this upgrade will be done automatically at container start time, and it will take a while.

Runtime error

If you left a Project Atomic installation, you’ve currently docker-runc as engine name. But for recent versions of Docker, the engine is simply runc.

You so need to replace it in hostconfig.json files.

From a Docker host with GNU sed available, you can do an inline replace:

This fixes the following error:

docker-runc not installed on system

Salt state

If you use SaltStack, you can use the following state.

This state directly downloads the docker-ce.repo file from the repository, to avoid to translate it in Salt pkgrepo states.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.