Home Wiki > SDB:Docker
Sign up | Login

SDB:Docker

tagline: From openSUSE


Tested on openSUSE Recommended articles Related articles
Icon-checked.png

Icon-manual.png Icon-help.png

Situation

You want to use Docker on openSUSE.


Procedure

This article describes several solutions:

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 "docker" and "docker-compose". 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.

on the command line

To install the docker and docker-compose packages:

zypper install docker docker-compose

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 YOURUSERNAME

where YOURUSERNAME is your user name.

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

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...

Warning Currently there is a bug that affects docker used in btrfs partitions. As a workaround you can create a different partition for /var/lib/docker.

docker and btrfs bug workaround

When you install docker in a machine that has /var/lib in a btrfs partition you can be hit by this bug. One way to workaround it is to create an ext4 partition and mount /var/lib/docker in that new partition. You can follow the steps below:

  • Uninstall docker:
zypper re docker docker-compose
  • Create /var/lib/docker:
mkdir /var/lib/docker
  • Create a new partition, and attach it to /var/lib/docker. You can use yast2. Follow the steps described in here.
  • Install docker:
zypper in docker docker-compose