Using Docker and Docker Compose inside GPU-enabled containers
To run containers with dstack, you can use your own Docker image (or the default one) without a need to interact
directly with Docker. However, some existing code may require direct use of Docker or Docker Compose. That's why,
in our latest release, we've added this option.
type: task
name: compose-task
image: dstackai/dind
privileged: true
commands:
- start-dockerd
- |
cat > compose.yaml <<'EOF'
services:
web:
image: python:3.11-slim
command: python -m http.server 9000
ports:
- "9000:9000"
EOF
- docker compose up
ports: [9000]
resources:
gpu: 16GB..24GB


