Skip to content

Latest commit

 

History

History
121 lines (91 loc) · 7.5 KB

docker.asciidoc

File metadata and controls

121 lines (91 loc) · 7.5 KB

Docker

The Docker commandlet allows to install and use Docker. Please note that besides the sandbox concept of devonfw-ide, docker is a global installation on your system. When uninstalling devonfw-ide, you may have to manually uninstall Docker if you do not need it anymore.

Editions

We support two editions of docker:

Table 1. Editions of docker
config (devon.properties) Meaning

DOCKER_EDITION=docker

Will install docker-desktop what requires a license and does NOT support Linux.

DOCKER_EDITION=rancher

Will install Rancher Desktop that is free for private and commerical use (default if DOCKER_EDITION is not set).

Important notice

On Windows WSL 2(Windows Subsystem for Linux) has to be installed properly. The installer should do that automatically for you but if something goes wrong or you still have WSL 1 instead you might end up with strange errors. In such case you need to run the following commands from an administrative shell:

wsl --update
wsl --set-default-version 2

To run the docker command after the installation, it is necessary that the docker daemon is up and running. In Docker-Desktop you can enable or disable autostart in the Preferences (gear icon in the title bar) at the General tab via the option Start Docker Desktop when you login (see also here). For Rancher-Desktop you can manually add it to the Windows Startup (auto-start).

Usage

The arguments (devon docker «args») are explained by the following table:

Table 2. Usage of devon docker
Argument(s) Meaning

setup

setup Docker (install and verify) as per above flow.

«args»

call docker with the specified arguments. Call docker help for details or use docker directly as preferred." («args»)

After Docker is installed, run docker help to get started and use the online documentations and resources on the web to get familiar with Docker. It is not our intention to repeat this here.

Please note that the docker commandlet is a command wrapper.

Setup

The Docker commandlet will install Docker-Desktop or Rancher-Desktop automatically. This depends on how the variable DOCKER_EDITION was set. We chose to set Rancher-Desktop as default for our installation, due to it being license free and supporting all operating-systems including Linux. See docker-desktop-alternative for a rationale with further details.

Docker Desktop

Docker-Desktop will be installed if the variable DOCKER_EDITION is set to docker. It requires a license for commercial use so you should only use it, in case you have such license. Further, it does not support Linux so in that case you can either install docker manually via your operating-system package-manager or use Rancher-Desktop instead. An advantage of Docker-Desktop is its advanced GUI that brings much better usability than rancher-desktop and the fact that it solves potential VPN issues out of the box.

Rancher Desktop

Rancher-Desktop will be installed if the variable DOCKER_EDITION is set to rancher (or more precicsely not set to docker). It is free for private and commercial use and supports all major operating systems (Windows, MacOS, and Linux). Like Docker-Desktop it comes with a nice GUI that however is rather basic. Please note that if you are using intellij ultimate edition, this also ships with a very powerful Docker integration.

You can simply click through the Rancher-Desktop installer. When asked for Container Runtime ensure you have dockerd selected if you want to use the docker CLI. For everything else the defaults should be fine. image::images/EnablingDockerd.png[]

VPN Fix

If you are connected to a VPN (e.g. Cisco Any Connect) you will run into problems while trying to start Rancher Desktop. Rancher Desktop will load for a long time as indicated by the progress bar on the lower left side of the Rancher Desktop GUI and finally file with a timeout error.

RDWaitingForServices

To avoid such problems all you need to do is go to the Preferences (gear icon) and checking the Enable networking tunnel option.

Rancher-Desktiop-Networking-Tunnel

Extensions

With version 1.9.0 Extensions were introduced to Rancher Desktop. These are comming from Docker Inc, Suse and others and can be installed directly from inside Rancher Desktop. Some are quite helpful:

  • Logs Explorer: Now you can see, filter and search the logs generated by all containers inside of Rancher Desktop

  • Resource usage: Shows you how many resources each and all containers use

  • Disk usage: Disk used by images, containers, volumes and cache

  • Dive In: This extension allows you to see how much space each file in an image uses and how many layers the image has. This helps to create smaller and faster images.

Requirements

Running Docker and especially Kubernetes on your machine in the background will require quite some resources. This will allocate at least 2GB of additional RAM.

You will need at least 8GB of total RAM while we recommend to use 16GB+.

You may also tune and scale it to your needs. When using Docker Desktop (Windows or MacOS) simply go to the resources tab in the settings. It will depend on your usage frequency if you want to have it running in the background all the time. This is a balance between resource utilization and convenience. If you use Docker and Kubernetes on your local machine on a daily basis this makes sense.

In case you only use Docker rarely, you can save resources by stopping it when not needed after it has been installed.

Mac M1/M2

Have a look at the Instructions on how to set startup programs for MacOS to make Rancher Desktop run directly after starting up your OS.

In case you have a new Mac with M1/M2 CPU, we automatically download and install the according ARM version of Docker Desktop or Rancher Desktop for macOS. However, if you use Docker and search for images you may end up with errors like:

docker: no matching manifest for linux/arm64/v8 in the manifest list entries.

So with M1/M2 CPU you may need to add --platform linux/x86_64 as option to your Docker command to find the expected container image.

Linux

Docker Desktop isn’t available for Linux, but Rancher Desktop can be used as compareable alternative as mentioned before.

To make the usage of Rancher Desktop more comfortable and reliable let your operating system run it after starting up your system. On many Linux distributions you can just go to your menu (usually by clicking the icon at your screens left bottom), type "startup" and start your systems GUI-startup manager, if popping up. At the following website you can find some examples or other options on how to set startup programs for some Linux distributions.