Static docker binaries

In this post, I will explain how you can install static binaries on Linux on IBM Z. There are some advantages to install static binaries, especially on Linux on IBM Z. First of all, Docker does not provide the docker package for all the distros for Linux on IBM Z (see support platforms) . The docker version provided by your distro could be old and you need a more recent docker version. If you are in one of these case, installing static binaries could be a viable solution. One of the drawbacks of this solution is that you need to manually update the docker binaries. The installation instructions could be found in the docker documentation.

In my case, I want to install the docker binaries 18.06.1 on a fedora 28 system. Fedora releases a pretty old docker version

$ cat /etc/os-release 
NAME=Fedora
VERSION="28 (Twenty Eight)"
ID=fedora
VERSION_ID=28
PLATFORM_ID="platform:f28"
PRETTY_NAME="Fedora 28 (Twenty Eight)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:28"
HOME_URL="https://fedoraproject.org/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=28
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=28
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"

$ rpm -q docker
docker-1.13.1-51.git4032bd5.fc28.s390x

You need to download the tarball and install the binaries that you find here.

$ docker_version=docker-18.06.1
$ wget https://download.docker.com/linux/static/stable/s390x/${docker_version}-ce.tgz
$ sudo tar xzvf ${docker_version}-ce.tgz
$ sudo cp docker/* /usr/bin/

However, if you want to deploy docker using systemd you also need to install the service. You can find in service file in the moby repository

$ curl -o docker.service https://raw.githubusercontent.com/moby/moby/master/contrib/init/systemd/docker.service.rpm
$ sudo install -m 0644 -o root docker.service /etc/systemd/system
$ sudo groupadd docker
$ sudo systemctl daemon-reload
$ sudo systemctl enable docker
$ sudo systemctl start docker

$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
fcce6e5e7797: Pull complete 
Digest: sha256:0add3ace90ecb4adbf7777e9aacf18357296e799f81cabc9fde470971e499788
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (s390x)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/ini

 

In the case you want to remove docker you also need to manually remove it.

Enjoy Docker on Linux on IBM Z!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s