11/23/2021»»Tuesday

Opensuse Docker

On the first run, Docker or Podman needs to download a container with an installation of DAPS on openSUSE Leap. This means, you need: Make sure you have at least 1.5 GB of space on your root partition left. Aug 27, 2021 Enable snaps on openSUSE and install docker. Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. Jul 11, 2020 Docker on OpenSUSE 15.2 / 15.1. As you see in the image above. Docker’s installation has been successful. To verify the current version of Docker, run the following command::$ sudo docker version. However, if you want to use Docker without root privileges, just use the following command::$ sudo usermod -aG docker $ (whoami) After that.

This blog is part of a series of technical blogs leading up to the release of openSUSE Leap 15. All of the blogs provide a use case regarding openSUSE Leap and the packages available in the distribution. Happy reading.

Authored by Max Huang

Docker is a software technology providing containers, promoted by the company Docker, Inc. Docker provides an additional layer of abstraction and automation of operating-system-level virtualization on Windows and Linux.

Docker

Docker implements a high-level Application Programming Interface to provide lightweight containers that run processes in isolation.

Because Docker containers are so lightweight, a single server or virtual machine can run several containers simultaneously.

Let’s do some hands on with Docker and openSUSE Leap 15.

####

Install Docker

Use GUI method

use yast2 sw_single install docker

Search docker

Select docker to install

Use command line to install docker

use zypper to install, if you don’t want interactive use #zypper -n install docker

Loading repository data…

Reading installed packages…

Resolving package dependencies…

The following 13 NEW packages are going to be installed:

containerd criu docker docker-bash-completion docker-libnetwork docker-runc git-core git-gui gitk libnet9

libsha1detectcoll1 python2-ipaddr python2-protobuf

The following recommended package was automatically selected:

criu

13 new packages to install.

Overall download size: 23.2 MiB. Already cached: 0 B. After the operation, additional 117.1 MiB will be used.

Continue? [y/n/…? shows all options] (y): Y

Check docker version when you install it

Docker version 17.09.1-ce, build f4ffd2511ce9

Start docker service and setup boot enable

GUI method

Use yast2 services-manager

click docker

click Start/Stop start docker service

click Enable/Disable Setup boot enable docker service

Click OK

Command line method

use systemctl command

Check docker service status

  • docker.service - Docker Application Container Engine

Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)

Active: inactive (dead)

Docs: //docs.docker.com

Start docker service

  • docker.service - Docker Application Container Engine

Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)

Active: active (running) since Fri 2018-04-27 21:24:09 CST; 3s ago

Docs: //docs.docker.com

Main PID: 13632 (dockerd)

Tasks: 9

Setup boot enable docker service

Checking boot status

disabled

Setup boot enable docker

Created symlink /etc/systemd/system/multi-user.target.wants/docker.service -> /usr/lib/systemd/system/docker.service.

enabled

Opensuse Docker

If you want, a normal user could use docker command

The docker package creates a new group named docker. Users, other than root user, need to be part of this group in order to interact with the Docker daemon. You can add users with:

#usermod -a -G docker

Example:

#usermod -a -G docker max

Practice: docker basic command

Check Docker version

Docker version 17.09.1-ce, build f4ffd2511ce9

Pull your first docker image

Using default tag: latest

latest: Pulling from library/busybox

f70adabe43c0: Pull complete

Digest: sha256:58ac43b2cc92c687a32c8be6278e50a063579655fe3090125dcb2af0ff9e1a64

Status: Downloaded newer image for busybox:latest

Check your docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

busybox latest 8ac48589692a 3 weeks ago 1.15MB

Search docker images on the web

For example, search opensuse

Search docker images with command

NAME DESCRIPTION STARS OFFICIAL AUTOMATED

opensuse This project contains the stable releases … 230 [OK]

opensuse/portus Production ready Docker image of Portus. 65 [OK]

Get your openSUSE docker images :)

The default is the latest if you not order tag

Using default tag: latest

latest: Pulling from library/opensuse

47aa660240a8: Pull complete

Digest: sha256:569e6ee7a622838b9fa1111c3bfa99a50fdb34b7503f945b7d18ce66bb94a369

Status: Downloaded newer image for opensuse:latest

Check your docker images again

REPOSITORY TAG IMAGE ID CREATED SIZE

Opensuse docker daemon not running

opensuse latest 35057ab4ef08 6 days ago 110MB

busybox latest 8ac48589692a 3 weeks ago 1.15MB

Get docker image with tag

42.3: Pulling from library/opensuse

Digest: sha256:569e6ee7a622838b9fa1111c3bfa99a50fdb34b7503f945b7d18ce66bb94a369

Status: Downloaded newer image for opensuse:42.3

Check your docker images again, you will see opensuse:latest and opensuse:42.3 has the same IMAGE ID because they are the same.

REPOSITORY TAG IMAGE ID CREATED SIZE

opensuse 42.3 35057ab4ef08 6 days ago 110MB

opensuse latest 35057ab4ef08 6 days ago 110MB

busybox latest 8ac48589692a 3 weeks ago 1.15MB

Of course, you could pull other images from docker hub, for example

Using default tag: latest

latest: Pulling from sakana/sshd

Digest: sha256:8f140e190db2d683b36cbac1d57410cdfb67029c4580b7b3aad3730005936544

Status: Downloaded newer image for sakana/sshd:latest

Practice: Run docker container

Know your docker container status before you go

You will not see anything when you use #docker ps command

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Run your first docker container with openSUSE

  • run execute docker

  • –rm Automatically remove the container when it exits

  • -i Keep STDIN open even if not attached

  • -t Allocate a pseudo-TTY

In the container

You could try to echo $HOSTNAME to check you are in docker contaienr now.

00172605a6e5:/ # echo $HOSTNAME

00172605a6e5

Leave the container

00172605a6e5:/ # exit

exit

Check docker container status with #docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Run docker container again without –rm

Opensuse Docker-compose

Cached

Leave the docker container

62d16d591ad0:/ # exit

exit

Check docker container status with #docker ps

You will find – if you not use –rm option, docker container will not remove from your host.

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

62d16d591ad0 opensuse “/bin/bash” 1 minute ago Exited 1 minute ago quizzical_almeida

View Max’s workshop about Docker and openSUSE at the openSUSE.Asia Summit. openSUSE Leap 15 is scheduled to be released on May 25.

Categories: Announcements Leap Tumbleweed Weekly News

Tags: command line containers Docker GUI openSUSE Leap 15 yast zipper

Share this post:

This is one topic of a package management diversity series.


This is a four-parts article. There are few sections here.

Part One
  • Preface: Test Bed
  • Getting Started With Docker
  • Issues on Minimal Install: No Reset, No Manual
  • Package Management: ZYpp Frontend, Get Help, Zypper Shell
  • Updating System: OS Release, List Updates, Update, Upgrades, Patch Check, Process Being Used
  • Package IRSIF: Install, Download Only, Removal, Dependency Removal, Query Search, Show Info, File List
  • What's Next
Part Two
  • Dependency: Help, Dependency, Reverse Dependency, Test, Verify
  • Group: Pattern
  • System Wide: List Packages
  • History: The Log File
  • Clean Up
  • What's Next
Part Three
  • Repositories: List, Add/Remove, Modify, Service List, Additional, Mirror
  • What's Next
Part Four
  • Build from Source: General Requirement, Download and Extract, Build Dependencies, Source Path, Build, Install RPM
  • Inspect Package: rpmlint, rpm -Qpl, rpmls, rpm2cpio
  • Hold Package: Case Example, Add Lock, Test Example, Remove Lock
  • Interesting Issue: systemd Dependencies
  • Conclusion

Repository

Zypper has amazing repository commands.

List Repository

Like usual, zypper manual is more than enough.I mean, always check the fine manual first.

Consider getting started with this simple command.

or a more complex one.

openSUSE put it in /etc/zypp/repos.d/.Like most configuration in unix world, you can edit manualy.

And here is what each repository configuration.

There is also zypper refresh command.

zypper refresh support process for specific repository.

Add/ Remove

It has been a riddle for a SUSE’s beginner like me,thinking about how openSUSE handle my weird favorites package,such as herbstluftwm.In openSUSE we have to add X11:windowmanagers first,using zypper addrepo command.

And refresh.

So that we can install herbstluftwm.

If you want, you can remove the newly add repository.

Modify

Always check the fine manual, like usual.

I like to change to change the repo directly, especially the long name,so I do not need to have long column in my terminal.And also I disable this newly added repo.

Consider zypper repos again.

Note that X11_windowmanagers has 1 index.Now we can enable it again using this command

Or using name, to make a clearer mandate.

And multiple command at once. Raise priority.

Or all remote repository at once.

Service List

There are other related command as well.I found this, about a month after this article written.

Opensuse Install Docker

Additional

There are also additional repository contain specific package,i.e driver and multimedia codec provided by packman.

Consider enable packman repository.

Sometimes packman cannot be reach.For this docker, I would rather remove it.

Mirror

Sometimes you need to switch mirror,whether just to find nearest mirror such as your campus,or because the main repository is has been down for a few hours.Unfortunately I can not find good reference on how to switch mirror in openSUSE.

All you need to do is go check the site,and make sure you check the column.

After this you may safely disable main repository.

Switching mirror has never been easier.

What’s Next

We have not finished yet. There is still Build from Source.Consider finish reading [ Part Four ].

Thank you for reading



Most Viewed Posts