Quick Steps to Install Docker-CE on OpenSUSE Linux

If you want to convert one of the stable and easy to use Linux OpenSUSE Tumbleweed or Leap 15.1 into a containerized virtualization platform by Docker installation, then here are the steps to follow…

Docker and OpenSUSE both are opensource platforms, however, SUSE is a full-fledged Linux operating system, while docker is a virtualization platform that can create and manage multiple virtual machines in an isolated container environment. The advantage of using Docker over other platforms such as Oracle VirtualBox or Vmware workstation player, it is lightweight, secure, run directly on OS kernel, quick to deploy machine, however, the difficult part is, a user has to give some to become proficient in using and managing the docker.

What do you need to set up Docker on SUSE?

  • Installed OpenSUSE Linux
  • A non-root user with sudo access
  • Internet connection

Docker Installation on OpenSUSE Tumbleweed or Leap 15.1

Step 1: Run Command line Terminal

If you are using the server version of the SUSE then you already on the command line just move to next step. Those are on GUI, they can either open the Terminal from Application or simply using the keyboard shortcut- CTRL+ALT+T.

Step 2:  System update 

Before moving further, just update your system that will ensure all the available packages and repositories are up to date.

sudo zypper update

Step 3: Docker Installation command for OpenSUSE

To install the Docker we don’t need to add any third-party repository, all the files we need to set up this virtualization platform are available on the official repo of OpenSUSE. That’s why in RPM-based Linux, I like it the most.

sudo zypper install docker-compose

When it will ask for your permission to download the packages, press Y and hit the Enter button.

The output for the above command:

Loading repository data...
Reading installed packages...
'docker-compose' not found in package names. Trying capabilities.
Resolving package dependencies...

The following 37 NEW packages are going to be installed:
catatonit containerd criu docker docker-bash-completion docker-libnetwork 
docker-runc git-core git-gui gitk
liblvm2cmd2_03 libnet9 libsha1detectcoll1 lvm2 perl-Error python3-attrs python3-bcrypt
 python3-cached-property
python3-docker python3-docker-compose python3-dockerpty python3-docker-pycreds
 python3-docopt python3-fluidity-sm
python3-gssapi python3-invoke python3-ipaddr python3-jsonschema python3-lexicon 
python3-paramiko python3-protobuf
python3-PyNaCl python3-pyrsistent python3-PyYAML python3-texttable python3-wcwidth
 python3-websocket-client

The following 6 recommended packages were automatically selected:
criu git-core lvm2 python3-gssapi python3-invoke python3-wcwidth

37 new packages to install.
Overall download size: 58.7 MiB. Already cached: 0 B. 
After the operation, additional 274.8 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y

Step 4: Enable and Start the Docker services

Once the installation has been completed, enable the docker service to run automatically with system boot and then start the same.

sudo systemctl enable docker
sudo systemctl start docker

Step 5: Enable Docker to run on OpenSUSE without sudo

Now, the thing is, every time, when we want to run docker on OpenSUSE, we have to use the sudo with it, if you are comfortable with that you can leave this step. However, those don’t want to repeat sudo with every docker command they can run the below-given syntax in their terminal.

Create Docker Group

Generally, with its installation, the script will automatically create a docker group on our system, however, you can run the below command to confirm that.

sudo groupadd docker

The output:

groupadd: group ‘docker’ already exists

Next, Add your current system user to Docker group

sudo gpasswd -a $USER docker

Now, reload the group ID during a login session., so that our shell could recognize that you are now the member of the docker group.

 newgrp dcoker

Note: Instead of running newgrp docker, you can also properly log out and log in again to run docker.

Step 6: Install some Docker image to check it

So, now this containerized platform is on our SUSE systems and its time to check, whether it is working fine or not, for that here we are downloading the latest Ubuntu Linux docker image

docker pull ubuntu

The above command will setup Ubuntu on OpenSUSE inside a virtual container running using docker.

After pulling and installing the image, we can run it:

docker run -it ubuntu

To exit the running docker container, simply type

exit or CTRL+D.

To see all installed containers, type:

docker ps

You can check out the official page to see the commands related to docker container update such a memory, CPU and more.

Install Docker-CE on OpenSUSE Linux-min

Run Docker-CE on OpenSUSE Linux

 

Other Linux tutorials:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.