Skip to main content
Docker requires systemd. Use the tensorlake/ubuntu-systemd base image, which includes systemd support.

Create the sandbox

tl sbx new my-docker-sandbox --image tensorlake/ubuntu-systemd --cpus 2.0 --memory 2048

Install Docker

Install Docker from the official Ubuntu repository:
tl sbx exec my-docker-sandbox bash -c '
set -e
apt-get update
apt-get install -y ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
. /etc/os-release && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu ${UBUNTU_CODENAME:-$VERSION_CODENAME} stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
'

Verify

tl sbx exec my-docker-sandbox docker run hello-world