Skip to content

1.3.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 20:21
· 4 commits to develop since this release
6901f1f

What's Changed

⚠️ Breaking changes

  • Mutual TLS by default. The Docker API is served only over mutual TLS, on port 2376, and d2k won't start without certificates.
    • On first start with no d2k-tls Secret, d2k creates a CA, a server certificate and a client certificate. The client certificate goes in the d2k-client Secret.
    • Plain TCP on 2375 is gone unless you set D2K_INSECURE=true.
    • To use your own CA, run d2k pki init, or have cert-manager issue the d2k-tls Secret.
  • Docker host mode is now the default (D2K_SWARM_MODE=false). If an install relied on Swarm mode, which was the 1.2.x default, set D2K_SWARM_MODE="true".
  • The admission policy is cluster-wide. deploy/admission-policy.yaml is a ValidatingAdmissionPolicy shared by every install on the cluster. Apply it once per cluster.
  • Pod security labels were removed from the namespace in the manifest. Pod security now comes from the cluster default or Portainer's Pod Security Standards policy.
  • Upgrading from 1.2.x happens in place. On first start, d2k migrates the Docker names, labels and start times that 1.2.x created. It can't recover what 1.2.x never kept: volume data written outside volumes, underscores in names, and compose's config hash. See README → Upgrading from d2k 1.2.x.
    • The first docker compose up of each project after upgrading re-creates every container in it, even if the compose file hasn't changed.

Feature

  • Docker Engine API 1.52.
    • The Docker CLI, Docker Compose and Portainer can now use d2k as they would a Docker daemon. It's the d2k side of D2K environments in Portainer BE.
    • The 1.52 spec is embedded and the routes are generated from it. Contract tests check every JSON response against the spec.
  • Containers.
    • The full create request is translated. Any setting with no Kubernetes equivalent is named in a warning instead of being dropped silently.
    • Container states come from the pods, and healthchecks become readiness probes.
    • Restart policies no and on-failure run once, as a pod. always and unless-stopped run as a Deployment replica.
    • stop, restart and rm -f return once the container has stopped, as Docker does. -t sets the grace period.
    • exec, attach, wait and TTY resize work from the Docker CLI and the Portainer console.
    • logs follows Docker's semantics, stats comes from the metrics API, and events are recorded as the Docker daemon records them.
    • docker cp into a container works before it starts, up to 1 MiB in total.
  • Compose and Swarm.
    • Compose attributes are no longer dropped silently.
    • Compose secrets and configs work, from the environment and from inline content.
    • A container's networks are recorded on it, so they survive d2k restarts.
    • A Swarm service's container carries Docker's task labels, so Portainer can give the container the service's ownership.
  • Volumes and images.
    • Volumes have Docker's shape, names and labels.
    • docker images lists the images that the namespace's containers use.
    • pull is acknowledged, since Kubernetes pulls the image when a container starts. Build, push, tag and prune answer 501.
  • Server.
    • Listens on mutual TLS (2376), a plain health port, and an optional unix socket.
    • Certificates reload when their Secret changes.
    • A preStop delay keeps connections from being dropped while d2k's pod restarts.
  • Hardened pod. d2k runs as a non-root user (65532), with a read-only root filesystem, no capabilities, and the RuntimeDefault seccomp profile.
  • Logging and API calls. Logging uses zerolog, client-side API calls are rate-limited, and docker ps makes a constant number of API calls whatever the namespace holds.

Fixes

  • d2k only acts on the objects it manages.
    • docker rm d2k could previously delete d2k itself.
    • docker rm api could delete my-api.
  • List filters are honoured. docker compose down, removing a stack in Portainer, and docker stack rm previously acted on every object in the namespace.
  • Docker-style errors.
    • Unsupported operations now answer 501 with a Docker error, not a plain-text 404.
    • Errors use Docker's status codes: 400, 404, 409 and 501.
    • Starting a running container, or stopping a stopped one, answers 304.
  • Container IDs are 64 hex characters and resolve as Docker resolves them: by exact name, or by ID prefix.
  • /info, /version and /_ping report the real host. NCPU is 1, not 0, under a CPU quota below one CPU.
  • --entrypoint "" clears the image's entrypoint, as in Docker.
  • Container names follow Docker's rules, so /web is accepted.
  • Security: replaced the frozen docker/docker module with github.com/moby/moby/api, removing two govulncheck advisories that have no fix.

Chore

  • Release workflow: :latest is no longer published with every release.
    • release.yml creates a pre-release and publishes only the versioned image tag.
    • The new promote-release.yml moves :latest only when a release is promoted to GitHub's latest. It retags the image already published, without rebuilding it.
    • A v-prefixed version input no longer leaks into the Docker tag.
  • CI:
    • Workflow files were renamed from .yaml to .yml, and their job and step names aligned.
    • The Docker Hub secret names were standardised to DOCKER_HUB_USERNAME / DOCKER_HUB_PASSWORD.
    • CI gates were added, workflows hardened, and the repository is lint-clean.
  • Tests: added kind end-to-end suites in test/e2e.

Full Changelog: 1.2.3...1.3.0