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
- An Ubuntu 22 VM
- Access to the domains below.
- 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:
- azure.archive.ubuntu.com (needed for sudo apt-get update)
- packages.microsoft.com (needed for sudo apt-get update)
- docker.com (needed for pulling docker containers)
- docker.io (needed for pulling docker containers)
- 6aa30f8b08e16409b46e0173d6de2f56.r2.cloudflarestorage.com
- OPTIONAL: huggingface.co (Some docker containers also have to download certain models hosted on huggingface.co)
- OPTIONAL: Docker maintains their own list of domains to allow, these are not all needed though.
Docker installation steps
- Follow the instructions under Install using the apt repository until the part where it asks you to test run the Hello World docker.
- Type the following command:
- sudo nano /lib/systemd/system/docker.service
- Within the [Service] section, type:
- EnvironmentFile=/etc/environment
- Save the file with CTRL+X, CTRL+Y and ENTER.
Install docker compose to run .yml file
sudo apt-get install docker-compose-plugin or this command if it does not work sudo apt install docker-compose
- Restart docker with the following commands:
- sudo systemctl daemon-reload
- sudo systemctl restart docker
- Test run the Hello World docker with:
- sudo docker run hello-world
Pulling and running docker containers
- For pulling a docker container, use the command:
- sudo docker pull [docker name]
- Replace [docker name] with the name of the docker container.
- For running a docker container, use the command:
- sudo docker run [docker name]
- If you're experiencing timeouts or the error urllibs3 ProxySchemeUnknown, the following command might solve it:
- sudo docker run -e HTTP_PROXY=http://11.5.0.4:3128 -e HTTPS_PROXY=http://11.5.0.4:3128 [docker name]