How to Install Docker on openSUSE Leap 15

Are you looking for an easy guide on how to install docker on openSUSE Linux?

The instructions on this page will show you how to install docker on openSUSE Leap 15.4.

Docker provides software platform where we can build, test and package application in a container image. Using the container image, we can quickly deploy application because that container image will have all the libraries, code, system tools and run time.

Prerequisites

  • Pre-Installed openSUSE Leap 15.4
  • Local user with sudo rights
  • Internet Connectivity

Without further ado, let’s jump into Docker installation steps.

1) Install Updates

Login to your openSUSE system and open the terminal and run following zypper command to install updates,

sudo zypper refresh
sudo zypper update -y

Once all the updates are applied, then reboot the system,

sudo reboot

2) Install docker with zypper command

Docker package and its dependencies are available in the default repositories of openSUSE Leap 15.4, run following zypper command to install docker,

sudo zypper install -y docker

zypper-command-install-docker-opensuse

Once the docker package installation is completed, start its service in the next step.

3) Start and enable docker service

Run the following systemctl commands to start and enable docker service,

sudo systemctl start docker
sudo systemctl enable docker

To verify the docker service status, run

sudo systemctl status docker

Docker-Service-Status-OpenSUSE-Leap

Execute the beneath command to view docker version,

sudo docker version

Docker-Version-Check-OpenSUSE-Leap

As you can see above, we have used sudo in front of docker command, so to allow local user to run docker command without sudo then add your local user to docker group as shown below,

sudo usermod -aG docker $USER
newgrp docker

Add-local-User-Docker-Group-OpenSUSE-Leap

4) Test docker installation

To test docker installation, let’s spin up a container using hello-world docker image,

docker run hello-world

docker-run-hello-world-opensuse-leap

Above informational message confirms that docker installation is successful.

Remove Docker

To remove docker from your system, run following set of commands,

sudo zypper remove docker
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

That’s all from this guide, please do submit your queries and feedback in below comments section.

Leave a Comment

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