Skip to main content
Uncloud supports a subset of the Docker Compose specification with some Uncloud-specific extensions. This page shows which features are supported.

Legend

  • Supported - Feature works as documented
  • ⚠️ Limited - Partial support or with restrictions
  • Not supported - Feature is not available

Services

FeatureStatusNotes
buildBuild context and Dockerfile
cap_addAdd Linux capabilities
cap_dropDrop Linux capabilities
commandOverride container command
configsFile-based and inline configs
cpusCPU limit (shorthand for deploy.resources.limits.cpus)
depends_on⚠️Services deployed in order, but conditions not checked
devicesDevice mappings
dnsUse built-in service discovery
dns_searchUse built-in service discovery
entrypointOverride container entrypoint
env_fileLoad environment variables from file
environmentEnvironment variables
gpusGPU device access
healthcheckHealth check configuration
imageContainer image specification
initRun init process in container
labelsNot supported
linksUse service names for communication
loggingDefaults to local driver
mem_limitMemory limit (shorthand for deploy.resources.limits.memory)
mem_reservationMemory reservation (shorthand for deploy.resources.reservations.memory)
mem_swappinessNot supported
memswap_limitNot supported
networksAll containers share cluster network
ports⚠️Standard ports limited to mode: host, use x-ports for HTTP/HTTPS
privilegedRun containers in privileged mode
pull_policySupports always, missing, never
scaleNumber of replicas (shorthand for deploy.replicas)
secretsUse configs or environment variables instead
security_optNot supported
stop_grace_periodTime to wait after SIGTERM before SIGKILL
storage_optNot supported
sysctlsNamespaced kernel parameters
ulimitsUser limits (nofile, nproc, etc.)
userSet container user
volumesNamed volumes, bind mounts, tmpfs

Deploy

FeatureStatusNotes
modeglobal or replicated
replicasNumber of container replicas
placementUse x-machines extension instead
resources⚠️CPU and memory limits/reservations, device reservations
restart_policyDefaults to unless-stopped
rollback_configNot yet implemented
update_config⚠️Supports order and monitor
labelsNot supported

Resources

| Feature | Status | Notes | |--------------------------------|--------|------------------------------------------------------------|| | resources.limits.cpus | ✅ | CPU core limit | | resources.limits.memory | ✅ | Memory limit | | resources.reservations.memory| ✅ | Memory reservation (guaranteed) | | resources.reservations.devices| ✅ | GPU and device reservations |

Volumes

| Feature | Status | Notes | |-----------------|--------|------------------------------------------------------------|| | Named volumes | ✅ | Docker volumes with local driver | | Bind mounts | ✅ | Host path binding | | Tmpfs mounts | ✅ | In-memory filesystems | | Volume labels | ✅ | Custom metadata labels | | External volumes| ✅ | Must exist before deployment | | Volume drivers | ⚠️ | Only local driver supported |

Configs

| Feature | Status | Notes | |-------------------|--------|------------------------------------------------------------|| | File-based configs| ✅ | Read config from file | | Inline configs | ✅ | Define config content in compose.yaml | | External configs | ❌ | Not supported | | Short syntax | ❌ | Must use long syntax | | uid/gid | ✅ | Set config file ownership | | mode | ✅ | Set config file permissions |

Uncloud extensions

| Extension | Status | Purpose | |--------------|--------|------------------------------------------------------------|| | x-ports | ✅ | Publish HTTP/HTTPS via Caddy or TCP/UDP via host mode | | x-caddy | ✅ | Custom Caddy reverse proxy configuration | | x-machines | ✅ | Machine placement constraints |

x-ports

Publish service ports via Caddy reverse proxy or bind directly to host:
services:
  web:
    image: nginx
    x-ports:
      # HTTPS via Caddy with automatic TLS
      - example.com:80/https
      
      # HTTP via Caddy
      - 8080:80/http
      
      # TCP port bound to host
      - 5432:5432/tcp@host
      
      # UDP port bound to host IP
      - 192.168.1.10:53:53/udp@host
Format:
  • Ingress mode (HTTP/HTTPS): [hostname:][published_port:]container_port/protocol
  • Host mode (TCP/UDP): [host_ip:]host_port:container_port/protocol@host
Supported protocols:
  • Ingress: http, https
  • Host: tcp, udp
When you specify a hostname with HTTPS, Uncloud automatically obtains a TLS certificate via Let’s Encrypt.
References: pkg/api/port.go, website/docs/8-compose-file-reference/1-support-matrix.md:82-94

x-caddy

Custom Caddy configuration for advanced reverse proxy features:
services:
  app:
    image: myapp
    x-caddy: |
      app.example.com {
        reverse_proxy {{ upstreams 8080 }}
        
        # Path-based routing
        handle /api/* {
          reverse_proxy {{ upstreams 8081 }}
        }
        
        # Static file serving
        handle /static/* {
          root * /var/www
          file_server
        }
      }
The {{ upstreams PORT }} template expands to all container IPs and the specified port.
x-caddy and x-ports with ingress mode are mutually exclusive. Use one or the other, not both.
References: website/docs/8-compose-file-reference/1-support-matrix.md:96-111

x-machines

Constrain which machines can run your service:
services:
  # Single machine
  db:
    image: postgres:16
    x-machines: db-server
    deploy:
      replicas: 1

  # Multiple machines
  gpu-worker:
    image: ml-worker
    x-machines:
      - gpu-machine-1
      - gpu-machine-2
    deploy:
      replicas: 4  # Spread across both machines
You can specify machine names or IDs. When deploying multiple replicas, Uncloud automatically distributes them across the specified machines.
If you specify a machine that doesn’t exist, Uncloud ignores it and uses only the existing machines.
References: website/docs/8-compose-file-reference/1-support-matrix.md:112-127

Not yet supported

These features are not currently supported but may be added in the future:
  • Secrets - Use configs with restrictive permissions or environment variables
  • Custom networks - All services share the cluster network
  • Depends_on conditions - Only startup order is respected
  • Rollback configuration - Manual rollback required
  • Network storage drivers - Only local volumes supported
  • Labels - Not used in Uncloud
  • DNS settings - Built-in service discovery handles this

Complete example

Here’s a compose.yaml using many supported features:
services:
  web:
    image: nginx:alpine
    x-ports:
      - myapp.example.com:80/https
      - 8080:80/http
    volumes:
      - web-content:/usr/share/nginx/html:ro
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    configs:
      - source: ssl-params
        target: /etc/nginx/ssl-params.conf
        mode: 0644
    healthcheck:
      test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost"]
      interval: 30s
      timeout: 5s
      retries: 3
    deploy:
      mode: replicated
      replicas: 3
      update_config:
        order: start-first
        monitor: 30s
      resources:
        limits:
          cpus: '0.5'
          memory: 256M
        reservations:
          memory: 128M

  api:
    build: ./api
    environment:
      - NODE_ENV=production
      - DATABASE_URL=postgres://db:5432/myapp
    env_file:
      - .env.production
    volumes:
      - api-logs:/var/log/api
    user: "1000:1000"
    x-machines:
      - api-server-1
      - api-server-2
    deploy:
      replicas: 4
      resources:
        limits:
          cpus: '1.0'
          memory: 1G

  db:
    image: postgres:16
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=secret
    x-machines: db-server
    stop_grace_period: 60s
    deploy:
      replicas: 1
      update_config:
        order: stop-first
      resources:
        limits:
          cpus: '2.0'
          memory: 4G

  ml-worker:
    image: tensorflow/tensorflow:latest-gpu
    gpus: all
    x-machines:
      - gpu-machine
    deploy:
      replicas: 2
      resources:
        limits:
          cpus: '4.0'
          memory: 8G
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

  monitoring:
    image: prom/node-exporter
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
    cap_add:
      - SYS_TIME
    deploy:
      mode: global  # One per machine

volumes:
  web-content:
    labels:
      app: myapp
  api-logs:
  db-data:
    driver: local

configs:
  ssl-params:
    file: ./configs/ssl-params.conf
References: pkg/client/compose/testdata/compose-full-spec.yaml

Build docs developers (and LLMs) love