How to install Docker Community Edition
How to install Docker CE

How To Install Docker On OpenSUSE Tumbleweed

In this short tutorial we will learn how to install Docker Community edition on OpenSuse Tumbleweed Linux operating system.

Introduction

Docker has emerged as a game-changer in modern software development, empowering organizations to build, ship, and run applications with unprecedented speed, efficiency, and agility. By embracing Docker’s containerization technology, businesses can accelerate innovation, reduce time to market, and unlock new opportunities for growth in today’s digital economy. As Docker continues to evolve and gain widespread adoption, its impact on the software industry is poised to be profound, reshaping the way we architect, deploy, and manage applications in the years to come.

Docker Installation On OpenSuse Tumbleweed

We can install Docker Engine in different ways, depending on our needs.

  • We can install Docker by using Docker’s repositories, for ease of installation and upgrade tasks. This is the recommended approach.
  • Install Docker manually. We can download the RPM package, install and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
  • In testing and development environments, we can use automated convenience scripts to install Docker.

In this tutorial we will install Docker on OpenSUSE using Docker’s repositories. By using this way we will do following steps :

  • Update Package Repository
  • Install Docker Engine
  • Start Docker
  • Verify Docker Engine installation

1. Update Package Repository

Before installing Docker on OpenSuse Tumbleweed, it’s a good practice to ensure that our system’s package repository is up to date. For this purpose we can do this by running:

$ sudo zypper refresh

Output :

ramansah@bckinfobckinfo:~> sudo zypper refresh
Repository 'Main Repository (NON-OSS)' is up to date.                                                                                   
Repository 'Main Repository (OSS)' is up to date.                                                                                       
Repository 'Main Update Repository' is up to date.                                                                                      
Repository 'openSUSE-20240131-0' is up to date.                                                                                         
Repository 'Open H.264 Codec (openSUSE Tumbleweed)' is up to date.                                                                      
All repositories have been refreshed.

2. Install Docker Engine

We will use the latest Docker repository. At this step we will also install containerd, and Docker Compose beside Docker Engine. We will do following command line :

$ sudo zypper install docker docker-compose docker-compose-switch

Output :

ramansah@bckinfobckinfo:~> sudo zypper install docker docker-compose docker-compose-switch
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 3 recommended packages were automatically selected:
  criu docker-buildx docker-rootless-extras

The following 17 NEW packages are going to be installed:
  catatonit containerd criu docker docker-bash-completion docker-buildx docker-compose docker-compose-switch docker-rootless-extras
  fuse-overlayfs libnet9 libslirp0 python311-ipaddr python311-protobuf rootlesskit runc slirp4netns

17 new packages to install.
Overall download size: 87.6 MiB. Already cached: 0 B. After the operation, additional 341.5 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): 
Retrieving: catatonit-0.2.0-1.3.x86_64 (Main Repository (OSS))                                                     (1/17), 290.5 KiB    
Retrieving: catatonit-0.2.0-1.3.x86_64.rpm .........................................................................[done (395.7 KiB/s)]
Retrieving: fuse-overlayfs-1.13-1.2.x86_64 (Main Repository (OSS))                                                 (2/17),  61.7 KiB    
Retrieving: fuse-overlayfs-1.13-1.2.x86_64.rpm .....................................................................[done (182.8 KiB/s)]
Retrieving: libnet9-1.3-1.2.x86_64 (Main Repository (OSS))                                                         (3/17),  50.4 KiB    
Retrieving: libnet9-1.3-1.2.x86_64.rpm .............................................................................[done (214.4 KiB/s)]
Retrieving: libslirp0-4.7.0+60-1.2.x86_64 (Main Repository (OSS))                                                  (4/17),  78.6 KiB    
Retrieving: libslirp0-4.7.0+60-1.2.x86_64.rpm ......................................................................[done (312.4 KiB/s)]
Retrieving: python311-ipaddr-2.2.0-1.23.noarch (Main Repository (OSS))                                             (5/17),  45.0 KiB    
Retrieving: python311-ipaddr-2.2.0-1.23.noarch.rpm ..................................................................[done (29.9 KiB/s)]
Retrieving: python311-protobuf-4.25.2-10.1.x86_64 (Main Repository (OSS))                                          (6/17), 341.0 KiB    
Retrieving: python311-protobuf-4.25.2-10.1.x86_64.rpm ..............................................................[done (640.7 KiB/s)]
Retrieving: rootlesskit-2.0.0-1.2.x86_64 (Main Repository (OSS))                                                   (7/17),   5.7 MiB    
Retrieving: rootlesskit-2.0.0-1.2.x86_64.rpm .........................................................................[done (2.6 MiB/s)]
Retrieving: slirp4netns-1.2.3-1.1.x86_64 (Main Repository (OSS))                                                   (8/17),  47.0 KiB    
Retrieving: slirp4netns-1.2.3-1.1.x86_64.rpm .......................................................................[done (192.1 KiB/s)]
Retrieving: criu-3.19-1.4.x86_64 (Main Repository (OSS))                                                           (9/17), 704.0 KiB    
Retrieving: criu-3.19-1.4.x86_64.rpm .................................................................................[done (2.0 MiB/s)]
Retrieving: runc-1.1.12-1.2.x86_64 (Main Repository (OSS))                                                        (10/17),   3.0 MiB    
Retrieving: runc-1.1.12-1.2.x86_64.rpm ...............................................................................[done (2.6 MiB/s)]
Retrieving: containerd-1.7.10-4.1.x86_64 (Main Repository (OSS))                                                  (11/17),  21.3 MiB    
Retrieving: containerd-1.7.10-4.1.x86_64.rpm .........................................................................[done (3.0 MiB/s)]
Retrieving: docker-25.0.3_ce-2.1.x86_64 (Main Repository (OSS))                                                   (12/17),  29.5 MiB    
Retrieving: docker-25.0.3_ce-2.1.x86_64.rpm ..........................................................................[done (2.8 MiB/s)]
Retrieving: docker-buildx-0.12.1-1.2.x86_64 (Main Repository (OSS))                                               (13/17),  12.7 MiB    
Retrieving: docker-buildx-0.12.1-1.2.x86_64.rpm ......................................................................[done (2.6 MiB/s)]
Retrieving: docker-rootless-extras-25.0.3_ce-2.1.noarch (Main Repository (OSS))                                   (14/17),  32.0 KiB    
Retrieving: docker-rootless-extras-25.0.3_ce-2.1.noarch.rpm .........................................................[done (33.7 KiB/s)]
Retrieving: docker-compose-2.24.6-1.1.x86_64 (Main Repository (OSS))                                              (15/17),  12.7 MiB    
Retrieving: docker-compose-2.24.6-1.1.x86_64.rpm .....................................................................[done (2.0 MiB/s)]
Retrieving: docker-compose-switch-1.0.5-1.5.x86_64 (Main Repository (OSS))                                       (16/17), 1012.3 KiB    
Retrieving: docker-compose-switch-1.0.5-1.5.x86_64.rpm ...............................................................[done (2.2 MiB/s)]
Retrieving: docker-bash-completion-25.0.3_ce-2.1.noarch (Main Repository (OSS))                                   (17/17),  43.2 KiB    
Retrieving: docker-bash-completion-25.0.3_ce-2.1.noarch.rpm .........................................................[done (57.8 KiB/s)]

Checking for file conflicts: .....................................................................................................[done]
( 1/17) Installing: catatonit-0.2.0-1.3.x86_64 ...................................................................................[done]
( 2/17) Installing: fuse-overlayfs-1.13-1.2.x86_64 ...............................................................................[done]
( 3/17) Installing: libnet9-1.3-1.2.x86_64 .......................................................................................[done]
( 4/17) Installing: libslirp0-4.7.0+60-1.2.x86_64 ................................................................................[done]
( 5/17) Installing: python311-ipaddr-2.2.0-1.23.noarch ...........................................................................[done]
( 6/17) Installing: python311-protobuf-4.25.2-10.1.x86_64 ........................................................................[done]
( 7/17) Installing: rootlesskit-2.0.0-1.2.x86_64 .................................................................................[done]
( 8/17) Installing: slirp4netns-1.2.3-1.1.x86_64 .................................................................................[done]
( 9/17) Installing: criu-3.19-1.4.x86_64 .........................................................................................[done]
(10/17) Installing: runc-1.1.12-1.2.x86_64 .......................................................................................[done]
(11/17) Installing: containerd-1.7.10-4.1.x86_64 .................................................................................[done]
/usr/bin/systemd-sysusers --replace=/usr/lib/sysusers.d/docker.conf -
Creating group 'docker' with GID 460.
Creating group 'dockremap' with GID 459.
Creating user 'dockremap' (docker --userns-remap=default) with UID 459 and GID 459.
Updating /etc/sysconfig/docker ...
(12/17) Installing: docker-25.0.3_ce-2.1.x86_64 ..................................................................................[done]
(13/17) Installing: docker-buildx-0.12.1-1.2.x86_64 ..............................................................................[done]
(14/17) Installing: docker-rootless-extras-25.0.3_ce-2.1.noarch ..................................................................[done]
(15/17) Installing: docker-compose-2.24.6-1.1.x86_64 .............................................................................[done]
update-alternatives: using /usr/bin/docker-compose-switch to provide /usr/bin/docker-compose (docker-compose) in auto mode
(16/17) Installing: docker-compose-switch-1.0.5-1.5.x86_64 .......................................................................[done]
(17/17) Installing: docker-bash-completion-25.0.3_ce-2.1.noarch ..................................................................[done]
Running post-transaction scripts .................................................................................................[done]

3. Start Docker

At the second step above, we just install Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default. At this step we will enable, start and verify Docker service by submitting commands line below :

$ sudo systemctl enable docker
$ sudo systemctl start docker
$ sudo systemctl status docker
$ docker version

Output :

ramansah@bckinfobckinfo:~> sudo systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
ramansah@bckinfobckinfo:~> sudo systemctl start docker
ramansah@bckinfobckinfo:~> sudo systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: disabled)
     Active: active (running) since Mon 2024-03-11 22:39:41 WIB; 2min 17s ago
TriggeredBy: ● docker.socket
       Docs: http://docs.docker.com
   Main PID: 18942 (dockerd)
      Tasks: 19
        CPU: 719ms
     CGroup: /system.slice/docker.service
             ├─18942 /usr/bin/dockerd --add-runtime oci=/usr/sbin/docker-runc
             └─18949 containerd --config /var/run/docker/containerd/containerd.toml --log-level warn

Mar 11 22:39:39 bckinfobckinfo.com systemd[1]: Starting Docker Application Container Engine...
Mar 11 22:39:39 bckinfobckinfo.com (dockerd)[18942]: docker.service: Referenced but unset environment variable>
Mar 11 22:39:39 bckinfobckinfo.com dockerd[18949]: time="2024-03-11T22:39:39.339097384+07:00" level=warning ms>
Mar 11 22:39:39 bckinfobckinfo.com dockerd[18949]: time="2024-03-11T22:39:39.339686460+07:00" level=warning ms>
Mar 11 22:39:40 bckinfobckinfo.com dockerd[18942]: time="2024-03-11T22:39:40.332580399+07:00" level=warning ms>
Mar 11 22:39:41 bckinfobckinfo.com systemd[1]: Started Docker Application Container Engine.
ramansah@bckinfobckinfo:~> docker version
Client:
 Version:           25.0.3-ce
 API version:       1.44
 Go version:        go1.20.14
 Git commit:        f417435e5
 Built:             Thu Feb 22 14:13:42 2024
 OS/Arch:           linux/amd64
 Context:           default
ramansah@bckinfobckinfo:~> sudo usermod -G docker -a $USER
ramansah@bckinfobckinfo:~> newgrp docker
Docker Service on OpenSuse

Then we will create a user and group which will be used dedicate for Docker service.

ramansah@bckinfobckinfo:~> sudo usermod -G docker -a $USER
ramansah@bckinfobckinfo:~> newgrp docker

4. Verify Docker Engine Installation

In this step we will verify if the Docker Engine installation is successful by running the hello-world image.

$ docker run --rm hello-world

Output :

ramansah@bckinfobckinfo:~> docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete 
Digest: sha256:d000bc569937abbe195e20322a0bde6b2922d805332fd6d8a68b19f524b7d21d
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.
    (amd64)
 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/


Server:
 Engine:
  Version:          25.0.3-ce
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.20.14
  Git commit:       f417435e5
  Built:            Thu Feb 22 14:13:42 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.10
  GitCommit:        4e1fe7492b9df85914c389d1f15a3ceedbb280ac
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94601ce
 docker-init:
  Version:          0.2.0_catatonit
  GitCommit:        
ramansah@bckinfobckinfo:~> docker images
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
hello-world   latest    d2c94e258dcb   10 months ago   13.3kB

Until this step, the Docker installation on OpenSuse is done.

Conclusion

In this short tutorial we have learnt how to install Docker on OpenSuse Tumbleweed operating system successfully. I hope this tutorial will be helpful.

(Visited 100 times, 1 visits today)

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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