Skip to content

Docker

Docker is a runtime for running containers. On Linux Docker utilizes the kernel to isolate and sandbox processes in virtual filesystems and networks. On Windows it does the same thing but runs a Linux virtual machine.

Warning

Docker Desktop must not be installed.

Install

Windows

Download and install Rancher Desktop.

You might have to enable some virtualization in BIOS and/or enable 'Hyper-V', 'Virtual Machine Platform' and 'Windows Subsystem for Linux' in Windows Features. A message about this should be shown automatically if necessary.

Linux (and WSL)

Follow the guide for your distro on docs.docker.com/engine/install.

Some projects require your user to be able to run docker commands directly. You may need to update your permissions: Ensure your user is part of the docker user group.

Login (Windows & Linux)

First add a hosts file entry that maps the hostname docker to your localhost machine. The hosts file can be found in:

  • Windows: C:\Windows\System32\drivers\etc\hosts
  • Linux: /etc/hosts

Add the following line at the end of the file:

127.0.0.1 docker

Now log in to the GitLab Docker registry:

  1. Create a GitLab Access Token with read_registry rights for use in Docker on your machine.
  2. Create a GitLab Access Token with api rights for use in scripts on your machine.
  3. Open your TTY shell of choice
  4. To be able to pull our own images run the command:
    docker login registry.gitlab.com
    
  5. To be able to pull images from the gitlab dependency proxy run the command:
    docker login gitlab.com
    

For both commands, use the following credentials:

  • username: Your GitLab username, which can be found on your Gitlab Account
  • password: If logging in to registry.gitlab.com, use the access token created in step 1. If logging in to gitlab.com, use the access token created in step 2.