Infrastructure at your Service

If you followed the last posts (Rancher, up and running, on EC2 – 1 – One node, Rancher, up and running, on EC2 – 2 – Three nodes and Rancher, up and running, on EC2 – 3 – Rancher setup) about Rancher, you know how to setup Rancher in a highly available RKE cluster. While this is the way to go for a production clusters, you might want to play with Rancher on a local VM and there is a solution for this as well. In the previous posts I’ve used Debian as the operating system, but as Rancher Labs was recently acquired by SUSE we’ll be using SLES 15 for the scope of this post: Bring up a Rancher playground on a single VM using SLES 15.

As this is intended to be a step by step guide, we’ll start from the very beginning: Download the SLES 15 ISO from here (you’ll need to create a free SUSE account for this). I’ve downloaded “SLE-15-SP2-Online-x86_64-GM-Media1.iso”, this is a minimal ISO which fetches all required packages from the SUSE repository. I prefer to do it like this, instead of downloading the full blown ISO. No matter which virtualization product you use, go through the standard setup and opt for a minimal installation:








You should have received a registration code after you created your SUSE account and downloaded the ISO. This on needs to go here:















Once the installation completed login, set a host name and update the system (which actually already is up to do as we fetched all sources from the SUSE repository):

localhost:~ $ hostnamectl set-hostname sles15ranger
localhost:~ $ zypper update
Refreshing service 'Basesystem_Module_15_SP2_x86_64'.
...
Reading installed packages...
Nothing to do.
localhost:~ $ 

Very much the same as in the previous posts, install a supported version of Docker:

sles15ranger:~ $ curl https://releases.rancher.com/install-docker/19.03.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17251  100 17251    0     0  84151      0 --:--:-- --:--:-- --:--:-- 84151

Either your platform is not easily detectable or is not supported by this
installer script.
Please visit the following URL for more detailed installation instructions:

https://docs.docker.com/engine/installation/

Ok, the official script from Rancher to install Docker is not working on SLES 15. Let’s try to find Docker in the official SUSE repositories:

sles15ranger:~ $ zypper search docker
Refreshing service 'Basesystem_Module_15_SP2_x86_64'.
Refreshing service 'SUSE_Linux_Enterprise_Server_15_SP2_x86_64'.
Refreshing service 'Server_Applications_Module_15_SP2_x86_64'.
Loading repository data...
Reading installed packages...

S | Name       | Summary                        | Type
--+------------+--------------------------------+--------
  | ovn-docker | Docker network plugins for OVN | package


For an extended search including not yet activated remote resources you may run 'zypper
search-packages' at any time.
Do you want to run 'zypper search-packages' now? [yes/no/always/never] (no): yes

Following packages were found in following modules:

Package                       Module or Repository                                                     SUSEConnect Activation Command                                  
----------------------------  -----------------------------------------------------------------------  ----------------------------------------------------------------
cilium-docker                 SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
containment-rpm-docker        SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
docker                        Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
docker-bash-completion        Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
docker-bench-security         SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
docker-debuginfo              Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
docker-distribution-registry  SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
docker-img-store-setup        Public Cloud Module (sle-module-public-cloud/15.2/x86_64)                SUSEConnect --product sle-module-public-cloud/15.2/x86_64       
docker-libnetwork             Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
docker-libnetwork-debuginfo   Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
docker-machine-driver-kvm2    SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
docker-runc                   Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
docker-runc-debuginfo         Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
kiwi-image-docker-requires    SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
ovn-docker                    Server Applications Module (sle-module-server-applications/15.2/x86_64)  SUSEConnect --product sle-module-server-applications/15.2/x86_64
python2-docker                SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
python2-docker-compose        SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
python2-dockerpty             SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
python2-docker-pycreds        SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
python3-docker                SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
python3-docker-compose        SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
python3-dockerpty             SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
python3-docker-pycreds        SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
rubygem-docker-api            SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
rubygem-docker-api-doc        SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
rubygem-docker-api-testsuite  SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
yast2-docker                  SUSE Package Hub (PackageHub/15.2/x86_64)                                SUSEConnect --product PackageHub/15.2/x86_64                    
zypper-docker                 Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
zypper-docker-debuginfo       Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         
zypper-docker-debugsource     Containers Module (sle-module-containers/15.2/x86_64)                    SUSEConnect --product sle-module-containers/15.2/x86_64         

To activate the respective module or product, use SUSEConnect --product.
Use SUSEConnect --help for more details.

Register the correct module

sles15ranger:~ $ SUSEConnect --product sle-module-containers/15.2/x86_64
Registering system to SUSE Customer Center

Updating system details on https://scc.suse.com ...

Activating sle-module-containers 15.2 x86_64 ...
-> Adding service to system ...
-> Installing release package ...

Successfully registered system

.. and install Docker:

sles15ranger:~ $ zypper install docker
Refreshing service 'Basesystem_Module_15_SP2_x86_64'.
Refreshing service 'Containers_Module_15_SP2_x86_64'.
Refreshing service 'SUSE_Linux_Enterprise_Server_15_SP2_x86_64'.
...
    dracut:  root=UUID=a836ce9e-5187-4b7f-9b57-dab7061a9fc9 rootfstype=btrfs rootflags=rw,relatime,space_cache,subvolid=267,subvol=/@/.snapshots/1/snapshot,[email protected]/.snapshots/1/snapshot
    dracut: *** Creating image file '/boot/initrd-5.3.18-24.52-default' ***
    dracut: *** Creating initramfs image file '/boot/initrd-5.3.18-24.52-default' done ***

Executing %posttrans scripts ...........................................................................................................................................................................................................................................[done]
sles15ranger:~ $ rpm -qa |grep -i docker
docker-runc-1.0.0rc10+gitr3981_dc9208a3303f-6.45.3.x86_64
docker-19.03.15_ce-6.46.1.x86_64
docker-libnetwork-0.7.0.1+gitr2908_55e924b8a842-4.31.1.x86_64
docker-bash-completion-19.03.15_ce-6.46.1.noarch
sles15ranger:~ # docker --version
Docker version 19.03.15, build 99e3ed89195c

From now on it is basically the same as in the last posts: Create the group, the user, grant sudo permissions:

sles15ranger:~ $ groupadd rancher
sles15ranger:~ $ useradd -g rancher -G docker -m -s /bin/bash rancher
sles15ranger:~ $ zypper install -y sudo
sles15ranger:~ $ echo "rancher ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
sles15ranger:~ $ sudo su - rancher
[email protected]:~> id -a
uid=1000(rancher) gid=1000(rancher) groups=1000(rancher),477(docker)
[email protected]:~> sudo ls /
bin  boot  dev  etc  home  lib  lib64  mnt  opt  proc  root  run  sbin  selinux  srv  sys  tmp  usr  var

Enable the Docker service:

[email protected]:~> systemctl list-unit-files | grep -i docker
docker.service                                                         disabled 
[email protected]:~> sudo systemctl enable docker.service
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
[email protected]:~> sudo systemctl start docker.service
[email protected]:~> sudo systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2021-03-10 17:22:38 CET; 9s ago
     Docs: http://docs.docker.com
 Main PID: 11647 (dockerd)
    Tasks: 18
   CGroup: /system.slice/docker.service
           ├─11647 /usr/bin/dockerd --add-runtime oci=/usr/sbin/docker-runc
           └─11670 docker-containerd --config /var/run/docker/containerd/containerd.toml --log-level warn

Mar 10 17:22:37 sles15ranger systemd[1]: Starting Docker Application Container Engine...
Mar 10 17:22:37 sles15ranger dockerd[11647]: time="2021-03-10T17:22:37+01:00" level=info msg="SUSE:secrets :: enabled"
Mar 10 17:22:37 sles15ranger dockerd[11647]: time="2021-03-10T17:22:37.235279401+01:00" level=warning msg="failed to load plugin io.containerd.snapshotter.v>
Mar 10 17:22:37 sles15ranger dockerd[11647]: time="2021-03-10T17:22:37.237574049+01:00" level=warning msg="could not use snapshotter devmapper in metadata p>
Mar 10 17:22:37 sles15ranger dockerd[11647]: time="2021-03-10T17:22:37.482542178+01:00" level=warning msg="Your kernel does not support swap memory limit"
Mar 10 17:22:37 sles15ranger dockerd[11647]: time="2021-03-10T17:22:37.483274269+01:00" level=warning msg="Your kernel does not support cgroup rt period"
Mar 10 17:22:37 sles15ranger dockerd[11647]: time="2021-03-10T17:22:37.483318836+01:00" level=warning msg="Your kernel does not support cgroup rt runtime"
Mar 10 17:22:37 sles15ranger dockerd[11647]: time="2021-03-10T17:22:37.483337545+01:00" level=warning msg="Your kernel does not support cgroup blkio weight"
Mar 10 17:22:37 sles15ranger dockerd[11647]: time="2021-03-10T17:22:37.483353569+01:00" level=warning msg="Your kernel does not support cgroup blkio weight_>
Mar 10 17:22:38 sles15ranger systemd[1]: Started Docker Application Container Engine.
[email protected]:~> 

Bring up the Rancher container:

[email protected]:~> sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher
Unable to find image 'rancher/rancher:latest' locally
latest: Pulling from rancher/rancher
92dc2a97ff99: Pull complete 
be13a9d27eb8: Pull complete 
c8299583700a: Pull complete 
ae230727f130: Pull complete 
e2a418ceec64: Pull complete 
41c75955621d: Pull complete 
a25218d04df4: Pull complete 
64cf9593a3b1: Pull complete 
7f2a7535acb4: Pull complete 
2a47ce145a9a: Pull complete 
c70b3a16811c: Pull complete 
2e96fb0520ed: Pull complete 
1994015c7fb0: Pull complete 
51f27cd739d1: Pull complete 
71a5f7388eaf: Pull complete 
5b5f2e14777f: Pull complete 
01c27c5d80ce: Pull complete 
e345527b0efa: Pull complete 
6100bdb86846: Pull complete 
Digest: sha256:736b2357df459f53a97ec8e31d3d8400575671a72faa232e61f222a1e09969f2
Status: Downloaded newer image for rancher/rancher:latest
[email protected]:~> docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                      NAMES
de177147eaa1        rancher/rancher     "entrypoint.sh"     50 seconds ago      Up 48 seconds       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   epic_engelbart

Point your browser to the IP address of your VM and confirm the warning:


Happy playing:

Leave a Reply

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

Daniel Westermann
Daniel Westermann

Principal Consultant & Technology Leader Open Infrastructure