Skip to content

DDEV no longer can detect plugins on NixOS #8183

@wolcen

Description

@wolcen

Preliminary checklist

Output of ddev utility test or ddev utility diagnose

Expand `ddev utility dockercheck && docker info` diagnostic information

Before recommended change:

Docker platform: linux-docker
Docker buildx version check: compose build requires buildx 0.17.0 or later: docker CLI plugin "buildx" not found.
Please install buildx: https://github.com/docker/buildx#installing
Using Docker context: default
Using Docker host: unix:///var/run/docker.sock
TLS not configured (no DOCKER_TLS_VERIFY or DOCKER_TLS)
docker-compose: v5.0.2
Docker version: 29.2.1
Docker API version: 1.53
Able to run simple container that mounts a volume.
Able to use internet inside container.
Skipping buildx test due to earlier buildx version check error.
Docker authentication is configured correctly
Docker provider checks completed with warnings. Please address the issues above.

After recommended change:

Docker platform: linux-docker
docker buildx version 0.31.1 meets requirements for minimum 0.17.0
Using Docker context: default
Using Docker host: unix:///var/run/docker.sock
TLS not configured (no DOCKER_TLS_VERIFY or DOCKER_TLS)
docker-compose: v5.0.2
Docker version: 29.2.1
Docker API version: 1.53
Able to run simple container that mounts a volume.
Able to use internet inside container.
docker buildx is working correctly (trivial build succeeded)
Docker authentication is configured correctly

FWIW, in both cases, docker recognizes the plugins (of course):

docker info
Client:
 Version:    29.2.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.31.1
    Path:     /nix/store/rkh0rc2nhdy7iian5vdhbsb8fmy0x21x-docker-buildx-0.31.1/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  5.0.2
    Path:     /nix/store/q2d8xphgqlvvdzlnb3pciryjxljq6c09-docker-compose-5.0.2/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 51
  Running: 6
  Paused: 0
  Stopped: 45
 Images: 562
 Server Version: 29.2.1
 Storage Driver: btrfs
  Btrfs:
 Logging Driver: journald
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: refs/tags/v2.2.1
 runc version:
 init version:
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.18.9-zen1
 Operating System: NixOS 26.05 (Yarara)
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 62.7GiB
 Name: supercell
 ID: aadd6246-42a4-4c10-87e5-bb3338075b80
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: true
 Firewall Backend: iptables

Since I believe I have found the issue and am just reporting it with adequate background information, I'm leaving out the test output and including only the docker results. If you really want the more complete information, I can include it (there's a lot I had to trim for it, so I decided to skip it for now).

Expected Behavior

I anticipated that ddev would see that buildx is indeed available (but for Nix reasons, due to recent changes in ddev, it will no longer see this).

Actual Behavior

ddev complains that buildx is not available

Steps To Reproduce

  1. On NixOS (in my case, flakes+unstable+home-manager)
  2. Update your flakes to include latest ddev (1.25.0 at time of writing is in nixpkgs - I used my own nixpkgs w/ddev 1.25.1)
  3. Check your setup with ddev utility dockercheck

Anything else?

Due to a recent change, ddev is no longer able to detect plugins on NixOS. Because DDEV is using docker's API with a set of known default plugin locations - which Nix does NOT use - it will not see the actual plugins available on the system.

The issue on NixOS (a result of it's very nature), is that the plugins are all compiled into the store and not linked to a common location. Instead, NixOS creates a wrapper that includes a variable which is then read by a patch to docker's plugin manager.

This makes Nix's docker no longer API compatible.

There is however a workaround (or three, as the case so often is), but I know one that works for me.

If you use home-manager, you can include something like the following:

  home.file = {
    ".docker/cli-plugins/docker-buildx" = {
      source = "${pkgs.docker-buildx}/libexec/docker/cli-plugins/docker-buildx";
    };
    ".docker/cli-plugins/docker-compose" = {
      source = "${pkgs.docker-compose}/libexec/docker/cli-plugins/docker-compose";
    };
  };

This will create symbolic links in your ~/.docker/cli-plugins directory to the buildx/compose plugin output locations. After adding this and rebuilding, DDEV again works for me.

I'm making this report here, as I suspect most users will come here first, but I will also raise this on the NixOS side to see if a better option might be available from their side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions