Installing docker on Ubuntu 22

Installing docker on Ubuntu 22

First version: 2023-11-24
Last version: 2024-01-12
Last change: Small corrections to reflect that domain allowlisting is now a self-service feature.

This is a community effort. The article was created through collaboration of the anDREa Support Team and Amsterdam UMC Support Team in their spare time. If you have found a more efficient way to approach this, please contact us and we will update the article.

Introduction

Docker is a platform designed to help developers build, share, and run container applications. Below we describe how to install docker on an Ubuntu 22 VM.

Requirements

  1. An Ubuntu 22 VM 
  2. Access to the domains below.
  3. Privileges in the Workspaces: Advanced Member or above.

Domain allowlisting

For docker to work, domain allowlisting is required.  Domain allowlisting is a self-service feature for Accountable and Privileged Members and can be initiated from the External Access tab in the Workspace.

The following domains are needed:
    1. azure.archive.ubuntu.com (needed for sudo apt-get update)
    2. packages.microsoft.com (needed for sudo apt-get update)
    3. docker.com (needed for pulling docker containers)
    4. docker.io (needed for pulling docker containers)
    5. OPTIONAL: huggingface.co (Some docker containers also have to download certain models hosted on huggingface.co) 

Docker installation steps

  1. Follow the instructions under Install using the apt repository until the part where it asks you to test run the Hello World docker.
  2. Type the following command:
  1. sudo nano /lib/systemd/system/docker.service 
  1. Within the [Service] section, type:
  1. EnvironmentFile=/etc/environment

  1. Save the file with CTRL+X, CTRL+Y and ENTER.
  1. Restart docker with the following commands:
  1. sudo systemctl daemon-reload
  2. sudo systemctl restart docker
  1. Test run the Hello World docker with:
  1. sudo docker run hello-world


Pulling and running docker containers

  1. For pulling a docker container, use the command:
  1. sudo docker pull [docker name]
  1. Replace [docker name] with the name of the docker container.
  1. For running a docker container, use the command:
  1. sudo docker run [docker name]
  1. If you're experiencing timeouts or the error urllibs3 ProxySchemeUnknown, the following command might solve it:
  1. sudo docker run -e HTTP_PROXY=http://11.5.0.4:3128 -e HTTPS_PROXY=http://11.5.0.4:3128 [docker name]

    • Related Articles

    • Installing Mathworks Matlab on Ubuntu

      The "normal" matlab install doesn't work on the current anDREa Ubuntu image because the home folder uses special characters (@), unzip is not installed and mathworks.com is blocked: This is a workaround: Requirements: Advanced Member in anDREa A ...
    • Linux VMs

      On the myDRE platform different types of Linux virtual machines (VMs) are available. CentOS 7.5 (is reaching its end of life) Ubuntu 20 (for GPU usage) Ubuntu 22 By default, Linux VMs have no connection to the outside world, so cannot be directly ...
    • Docker

      Docker is a tool that essentially lets you package a (development) environment with all its settings and dependencies, and move it to another machine, such that whatever you create and develop works the same on every machine you want to run it on. ...
    • Docker stopped working on Windows VMs - summary of tests and alternative

      First version: 2023-10-30 Last version: - Last change: - This is a community effort. The article was created by the anDREa Support Team in their spare time. If you have found a more efficient way to approach this, please contact us and we will update ...
    • NVIDIA-docker

      This article describes how to install NVIDIA-docker on a Linux VM in two parts. kudos to Bob van Dijk - Amsterdam UMC Download and ingress the attachment for easy copy/paste. Part 1: install and start the latest NVIDIA drivers for your GPU card Open ...