Before you start
- Install the Celesto command-line tool. For cloud computers, also sign in.
- Use a fresh Ubuntu sandbox with the current Celesto software and image. Celesto starts Docker’s background service automatically after you install it.
- Allow internet access to Ubuntu package servers and Docker Hub, the service that stores the example images.
- Give Docker room for package downloads and images. For the local example, start with 2048 MiB of memory and 4096 MiB of disk space. MiB is a unit of memory and storage size. For cloud computers, use Standard size or larger.
Install Docker and run a container
1
Open your sandbox
Run the commands in the tab for your setup on your own machine.Run the remaining commands in this section inside the sandbox.
- Local sandbox
- Cloud computer
Create an Ubuntu sandbox named The terminal runs inside your sandbox as
docker-demo and open its terminal:root, the user with permission to install software.2
Install Docker
Download the package list, then install Docker and its network tools:Wait for the installation to finish successfully. Celesto detects Docker and starts its daemon, the background service that runs containers.
3
Wait for Docker to be ready
This check waits up to two minutes. If startup fails, it prints the Docker log to help you find the cause.Continue when you see
Docker is ready.4
Run your first container
Download and run Docker’s small verification image:The
The output includes
Hello from Docker!. This confirms Docker can download an image and run a container inside your sandbox.--rm flag removes the container after it finishes. Docker keeps the downloaded image so you can reuse it. See Docker’s guide to running containers for more options.Run Docker from Python
Use the Python SDK (software development kit) to create a local Ubuntu sandbox, install Docker, and run a container from your program. Run this script on your own machine after completing Celesto installation. Save it asdocker_demo.py:
docker_demo.py
Hello from Docker!. The script checks each command’s exit code and gives package installation and image downloads extra time to finish.
Troubleshoot Docker in a Celesto sandbox
Run these checks inside the sandbox with the same permissions you used during installation.Docker cannot connect to its background service
Docker cannot connect to its background service
Run the readiness check again, then read the startup log:Celesto manages the service through its guest agent, a small program inside the sandbox. Use a fresh Ubuntu sandbox with the current image if an older sandbox has no Docker startup log. The setup above uses Celesto’s service management rather than
systemctl.Package installation or image downloads fail
Package installation or image downloads fail
Check whether the sandbox can find the package server and Docker Hub:Each command should print IP addresses. If a lookup fails, check internet access and outbound network rules for your local sandbox or cloud computer. Then retry the failed installation or download command.
Docker runs out of disk space or memory
Docker runs out of disk space or memory
Check available disk space and Docker’s storage use:Create a larger sandbox when your Docker images or builds need more space. For cloud computers, compare computer sizes. Increase memory when programs run out of memory. Docker images and containers use the sandbox’s own resources.
Next steps
- Forward a local sandbox port to reach a container’s web app from your machine. Publish the container port to the sandbox with Docker’s
-pflag first. - Publish a cloud computer port to give a container’s web app an HTTPS address.
- Build custom sandbox images when you want to choose the tools available when a sandbox starts.
- Build a Celesto Cloud custom template to start every cloud computer with your packages preinstalled.
