FoxuTech

How to upgrade Docker-Engine on Linux

How to upgrade docker-engine on Linux

To upgrade Docker-engine service from currently installed version to another, there is some different method’s/versions have to follow, below will see what are those methods,

Best Practice: Before starting docker upgrade, make sure you stopped all running containers on the host. Why because this help container to clean up the data and also helps to avoid data loss.

Upgrade from the same minor version

Here will see how to upgrade some minor version of Docker-Engine. As an example, from 1.x.0 to 1. x.1.

In CentOS 7.1 & RHEL 7.0/7.1

Instructions to upgrade YUM-based systems.

  1. Update your docker-engine package:
# yum upgrade docker-engine
  1. Check that the CS Docker Engine is running:
# docker info

In Ubuntu 14.04 LTS

Instructions to upgrade APT-based systems.

  1. Update your docker-engine package:
# apt-get update 
# apt-get upgrade docker-engine
  1. Check that the CS Docker Engine is running:
# docker info

In SUSE Enterprise 12.3

  1. Update your docker-engine package:
# zypper upgrade docker-engine
  1. Check that the CS Docker Engine is running:
# docker info

Upgrade from the same major version

Here will see how to upgrade some major version of CS Docker-Engine. As an example, from 1.x.x to 1.y.x.

In CentOS 7.1 & RHEL 7.0/7.1

Instructions to upgrade YUM-based systems.

  1. Add the Docker Engine repository.
# yum-config-manager --add-repo https://packages.docker.com/1.12/yum/repo/main/centos/7

This adds the repository of the latest version of CS Docker Engine. If you wish to install other version, you can modify based on that.

  1. Install the new package:
# yum update docker-engine
  1. Check that the CS Engine is running:
# docker info

In Ubuntu 14.04 LTS

Use these instructions to update APT-based systems.

  1. Add the docker engine repository.
# echo "deb https://packages.docker.com/1.12/apt/repo ubuntu-trusty main" | tee /etc/apt/sources.list.d/docker.list

This adds the repository of the latest version of CS Docker Engine for the Ubuntu Trusty distribution. Change the “ubuntu-trusty” string to the distribution you’re using:

    • debian-jessie (Debian 8)
    • debian-stretch (future release)
    • debian-wheezy (Debian 7)
    • ubuntu-precise (Ubuntu 12.04)
    • ubuntu-trusty (Ubuntu 14.04)
    • ubuntu-utopic (Ubuntu 14.10)
    • ubuntu-vivid (Ubuntu 15.04)
    • ubuntu-wily (Ubuntu 15.10)
  1. Update your docker-engine package.
# apt-get update 
# apt-get upgrade docker-engine
  1. Check that the CS Engine is running:
# docker info

In SUSE Enterprise 12.3

  1. Add the docker engine repository.
# zypper ar -t YUM https://packages.docker.com/1.12/yum/repo/main/opensuse/12.3 docker-1.12

This adds the repository of the latest version of CS Docker Engine. You can customize the URL to install other versions.

  1. Install the new package:
# zypper update docker-engine
  1. Check that the CS Engine is running:
# docker info

Read More: About Docker

Upgrade from a legacy version

Use these instructions if you’re upgrading your CS Docker Engine from a version prior to 1.9. In this case you’ll have to first uninstall CS Docker Engine, and then install the latest version.

In CentOS 7.1 & RHEL 7.0/7.1

Use these instructions to upgrade YUM-based systems.

  1. Remove the current CS Engine:
# yum remove docker-engine-cs
  1. Add the Docker public key for CS packages:
# rpm --import "https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e"

Note: if the key server above does not respond, you can try one of these:

    • pgp.mit.edu
    • keyserver.ubuntu.com
  1. Install yum-utils if necessary:
# yum install -y yum-utils
  1. Add the repository for the new version and disable the old one.
# yum-config-manager --add-repo https://packages.docker.com/1.12/yum/repo/main/centos/7
# yum-config-manager --disable 'Docker_cs*'

This adds the repository of the latest version of CS Docker Engine. You can customize the URL to install other versions.

  1. Install the new package:
# yum install docker-engine
  1. Enable the Docker daemon as a service and start it.
# systemctl enable docker.service
# systemctl start docker.service

In Ubuntu 14.04 LTS

Use these instructions to update APT-based systems.

  1. Remove the current Engine:
# apt-get remove docker-engine-cs
  1. Add the Docker public key for CS packages:
# curl -s 'https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e' | apt-key add --import

Note: if the key server above does not respond, you can try one of these:

    • pgp.mit.edu
    • keyserver.ubuntu.com
  1. Install the HTTPS helper for apt (your system may already have it):
# apt-get update # apt-get install apt-transport-https
  1. Install additional virtual drivers not in the base image.
# apt-get install -y linux-image-extra-virtual

You may need to reboot your server after updating the LTS kernel.

  1. Add the repository for the new version:
# "deb https://packages.docker.com/1.12/apt/repo ubuntu-trusty main" | tee /etc/apt/sources.list.d/docker.list

This adds the repository of the latest version of CS Docker Engine for the Ubuntu Trusty distribution. Change the “ubuntu-trusty” string to the distribution you’re using:

    • debian-jessie (Debian 8)
    • debian-stretch (future release)
    • debian-wheezy (Debian 7)
    • ubuntu-precise (Ubuntu 12.04)
    • ubuntu-trusty (Ubuntu 14.04)
    • ubuntu-utopic (Ubuntu 14.10)
    • ubuntu-vivid (Ubuntu 15.04)
    • ubuntu-wily (Ubuntu 15.10)
  1. Install the upgraded package:
# apt-get upgrade docker-engine
Exit mobile version