Docker

Jump to: navigation, search



Installation

Tumbleweed packages: docker docker-compose docker-compose-switch
Leap packages: docker python3-docker-compose

with YaST2

To install the docker and docker-compose packages start YaST2, select "Software" and start the module "Software Management". Search for docker and choose to install the Packages appropriate for the openSUSE flavor you're running. Then click "Accept", and if the installation was successful, "Finish".

To start the docker daemon during boot start YaST2, select "System" and start the module "Services Manager". Select the "docker" service and click "Enable/Disable" and "Start/Stop". To apply your changes click "OK".

To join the docker group that is allowed to use the docker daemon start YaST2, select "Security and Users" and start the module "User and Group Management". Select your user and click "Edit". On the "Details" tab select "docker" in the list of "Additional Groups". Then click "OK" twice.

Now you have to "Log out" of your session and "Log in" again for the changes to take effect.

with Command line

Install packages

To install the docker and docker-compose packages:

zypper install docker docker-compose docker-compose-switch

Enable, start, run Docker

To start the docker daemon during boot:

sudo systemctl enable docker

To join the docker group that is allowed to use the docker daemon:

sudo usermod -G docker -a $USER

Log in to the docker group:

newgrp docker

Restart the docker daemon:

sudo systemctl restart docker

Verify docker is running:

docker version

This will pull down and run the, "Hello World" docker container from dockerhub:

docker run --rm hello-world

Clean up and remove docker image we pulled down:

docker images

docker rmi -f IMAGE_ID

Where "IMAGE_ID" is the Id value of the "Hello World" container.

Adding buildx Support As Plugin Where It Is Not Included By Default

This concerns (e.g.) s390x. The following commands can all be executed in your home directory on your LinuxONE instance/machine. The steps outlined here can be used analogously for other docker plugins (provided that a binary for the architecture in question is actually available).

Perform the following steps (v0.6.1 should be treated like a placeholder, it just happened to be the current version at the time of this writing. An overview of all available releases can always be obtained by just browsing releases w/o any additional URL components; command output for .eg. wget has deliberately been omitted for the sake of brevity):

mkdir -p .docker/cli-plugins

wget https://github.com/docker/buildx/releases/download/v0.6.1/buildx-v0.6.1.linux-s390x

cp buildx-v0.6.1.linux-s390x .docker/cli-plugins/docker-buildx

chmod +x .docker/cli-plugins/docker-buildx

docker buildx version

Use Docker

If you followed the instructions your openSUSE is ready to make use of docker containers. Dive into the great docker documentation and have a lot of fun...