Skip to content

Latest commit

 

History

History
141 lines (92 loc) · 8.64 KB

docker.asciidoc

File metadata and controls

141 lines (92 loc) · 8.64 KB

Docker

The Docker commandlet allows to install and use Docker. On Windows WSL 2(Windows Subsystem for Linux) has to be installed properly as a prerequisite. In case of using Rancher Desktop the process of enabling WSL and installing a WSL distribution will be handled by Rancher Desktop. This commandlet also offers the installation of Rancher Desktop, which works on Windows, Mac and Linux. To run the tools installed and managed by Rancher Desktop it is necessary to have Rancher Desktop up and running. To assure that you are able to use these tools directly after startup, you can add Rancher Desktop to the startup programs of your Operating System. Such instructions will be given below inside the sections for Windows, Mac and Linux.

ATTENTION: Currently this feature is new and therefore experimental. It may change in incompatible ways in the next releases until we reach a stable state. We hope that all is working fine for you. However, do not expect everything to work out of the box. In case you are facing issues (e.g. network problems with Cisco AnyConnect, etc.) please give us feedback so we can improve.

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

Table 1. 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»)

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 standard for our installation, due to it being license free compared to Docker Desktop while offering a similar tool set. Please read the document docker-desktop-alternative motivating why we added Rancher Desktop to the docker commandlet or read the section 'Docker Desktop' if you want to use Docker Desktop instead.

Docker Desktop

Docker Desktop can still be used by setting the variable DOCKER_EDITION equal to "DOCKERDESKTOP". This can be done by your projects ide-admin in the settings file. If you want to switch from Rancher Desktop to Docker Desktop, then add a line with the following content "DOCKER_EDITION=DOCKERDESKTOP" (without the quotes around the allocation) to the file devon.properties located at the path ${DEVON_IDE_HOME}/conf/devon.properties.

Rancher Desktop

The installation of Rancher Desktop will be handled with the help of a graphical user interface. After starting the installation process from your shell you may see a small progress window for a few seconds before the installer starts.

RDInstallerInfoWindow

After that you may need to wait for around half a minute until the installer of Rancher Desktop pops up. Then, when you accepted the Licence Agreement

RDInstallPic1

the installation process starts, which will look like this:

RDInstallPic2

After successfull installation please start Rancher Desktop and go to the menu point "Kubernetes Settings". Under "Container Runtime" choose dockerd(moby) to enable the docker-cli.

EnablingDockerd

If you use Windows, then make sure to go to the Settings named "WSL Integration". There you can choose the WSL Shells you want Rancher Desktop to work on.

WSLdistrosRD

Besides that the tools like docker or kubectl should directly work with CMD or Powershell.

Please note that besides the sandbox concept of devonfw-ide this is a global installation on your system. When uninstalling devonfw-ide, you may have to manually uninstall Docker and Kubernetes, or Rancher Desktop if you do not need it anymore. At least uninstalling Rancher Desktop should leave way less remains if you did not install one of the related software Rancher Desktop offers separately.

If you are connected to a VPN you may run into problems while trying to start Rancher Desktop on Windows. E.g. Rancher Desktop will load for a long time as indicated by the progress bar on the lower left side of the Rancher Desktop GUI.

RDWaitingForServices

To fix this common issue related to WSL2, we included this wsl-vpnkit to the installation of Rancher Desktop. If you still run into problems, then please disconnect from your VPN, start Rancher Desktop and wait untill the progress bar disappears

RDCompletedStartup

or, when using Windows, untill you see a small blue Rancher Desktop icon in your Notification Area (in the following picture it is on the right bottom of the screen next to the taskbar).

RDCompletedIconNotificArea

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.

Windows and macOS

For Windows 10 you can use the following Instructions on how to set startup programs for Windows 10, so that Rancher Desktop starts with your OS.

To enable or disable autostart, you can launch Docker Desktop on Windows or MacOS go to the Preferences (gear icon in the title bar). Then in the General tab you can check or uncheck the option Start Docker Desktop when you login (see also here). When autostart is disabled and you launch Docker Desktop it will notice and ask you to start the service or do this automatically for you. On Windows you can also manually tweak this:

  • Hit [windows][r]

  • Enter services.msc

  • Confirm with OK

  • In the services app search for the Docker Desktop Service in the list and select it.

  • Now you can start or stop the service by clicking on the according link text.

  • Also when right clicking on Docker Desktop Service and selecting Options from the context-menu, you can change the start type to automatic or manual.

Mac A1

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 A1 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 A1 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.

usage

Once installed via setup, you can run Docker from any shell of your OS directly. If you use Rancher Desktop just make sure that Rancher Desktop runs in the background. 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.