Running a Container for Data Science on a Cloud Server
The Ubuntu repository may contain an outdated Docker version, so this instruction describes how to install the recent version from the official Docker repository:
-
Create a cloud server according to the instructions.
-
Update the current list of packages.
sudo apt update
- Install the tools that will allow apt to use HTTPS.
sudo apt install apt-transport-https ca-certificates curl software-properties-common
- Add the GPG key for the official Docker repository.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- Add the Docker repository to the APT resources.
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
- Update the database with Docker packages from the added repository.
sudo apt update
- Make sure you install the package from the Docker repository (and not from the default Ubuntu repository).
apt-cache policy docker-ce
- The output will be similar to this (the Docker version may differ):
Output of apt-cache policy docker-ce
docker-ce:
Installed: (none)
Candidate: 18.03.1~ce~3-0~ubuntu
Version table:
18.03.1~ce~3-0~ubuntu 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
- Install Docker.
sudo apt install docker-ce
- Make sure that Docker is working.
sudo systemctl status docker
The output should be similar to this, showing that the service is up and running:
Output
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-07-05 15:08:39 UTC; 2min 55s ago
Docs: https://docs.docker.com
Main PID: 10096 (dockerd)
Tasks: 16
CGroup: /system.slice/docker.service
├─10096 /usr/bin/dockerd -H fd://
└─10113 docker-containerd --config /var/run/docker/containerd/containerd.toml
- Download the container from the repository.
docker pull selectel/selectel-ml
- Start the container.
docker run -d -p 8888:8888 selectel/selectel-ml
- Run Jupyter Notebook: enter the external server IP address and the port number from the previous step in the address bar of your browser. For example: 203.0.113.1:8888. In the Jupyter Notebook web interface that opens, enter the default password:
9lG0eXCevt
.
Learn more about how to change your password in the Jupyter Notebook documentation.