docker

The Docker engine, CLI, Compose v2, and buildx — with the login user in the docker group.

Installs a complete Docker setup: the engine, the CLI, the Compose v2 plugin, and buildx. This is the devtool behind “run my docker compose stack on a workstation”.

devtools:
  - name: docker

The version field is not used by this recipe.

What it does

On Debian and Ubuntu it declares Docker’s official apt repository (resolving your workstation’s distribution and codename automatically), installs docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, and docker-compose-plugin, then enables and starts the daemon under systemd.

On Alpine it installs the distribution’s docker, docker-cli, docker-cli-compose, and docker-cli-buildx packages.

Afterwards it adds the workstation’s login user to the docker group, so docker ps works without sudo. You do not need to list docker under identity.groups.

On a workstation without systemd, the daemon is not started by this recipe — the runtime starts it instead.

When it counts as installed

The workstation only counts as having Docker when all three of these succeed: docker is on PATH, docker compose version works, and docker buildx version works. A workstation with the engine but no Compose plugin is not fully configured and the recipe re-runs — which is why Configured on a workstation that declares this devtool is a real promise that docker compose up will work.

Example

Clone a repository, install Docker, and bring the stack up — forwarding the published port back to your laptop:

apiVersion: workstations.ringleader.dev/v1
kind: WorkstationConfig
metadata:
  name: compose-box
  namespace: local
spec:
  selector:
    matchLabels:
      app: myapp
  identity:
    user: dev
    shell: /bin/bash
  packages:
    - git
    - curl
  devtools:
    - name: docker
  sources:
    - name: myapp
      git:
        url: https://github.com/acme/myapp.git
        ref: main
      path: /home/dev/src/myapp
  ports:
    - 8080
  defaultLocalBinding:
    enabled: true
    autoForward:
      forwardAll: true
  scripts:
    - name: compose-up
      phase: user                 # runs as `dev`, who is in the docker group
      runPolicy: onChange         # re-runs whenever the synced source advances
      content: |
        set -e
        cd ~/src/myapp
        docker compose up --build -d

Because devtools install before scripts, docker compose already exists the first time compose-up runs.

Notes

  • Pair with kind to get a local Kubernetes cluster on top of the engine — kind needs Docker and should be declared after it.
  • On Debian and Ubuntu the packages arrive through the normal repository and package phases, so they interleave correctly with your own packages and packageRepositories.