Gitpod Flex dev environments support Docker in two primary ways:
- Using the pre-installed Docker engine inside the host virtual machine (VM).
- Running Docker-in-Docker (DinD) inside the dev container.
Every Gitpod Flex development environment runs inside a dedicated virtual machine. Inside this VM, Gitpod Flex launches a Docker engine, which in turn runs your dev container.
When you connect to your environment using an IDE, the terminal and file system you access are inside this dev container. This container is fully customizable and rebuildable to suit your development needs.
However, the outer VM and the host Docker engine are not intended to be modified by the user.
graph TD
subgraph Host VM [Gitpod Flex Virtual Machine]
DE[Docker Engine]
subgraph DC[Dev Container]
FS[File System]
Term[Terminal Access]
end
end
To run Docker inside your dev container independently of the host Docker engine, you can set up Docker-in-Docker.
This approach involves running a separate Docker daemon inside your dev container. Refer to official DinD src for an example for configuration and security considerations.
An alternative to DinD is to use the host's Docker engine from within the dev container — a setup known as Docker Outside Docker (DoD). This is done by mounting the Docker socket from the host into the container.
This is the recommended and most convenient method. See the official repository for an example
If you prefer not to use the DevContainer feature, you can configure DoD manually: