Docker init not working using docker-outside-docker

Hi, I’m trying to use docker init inside a dev container which has the docker-outside-docker feature.

When i run the command i get: docker: 'init' is not a docker command.

when i run docker --help i cant see init* under management commands.

for docker version i get:

Client:
 Version:           26.1.1-1
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        4cf5afaefa0bec8ab94fcf631add24e284d0ecbf
 Built:             Tue Apr 30 11:40:03 UTC 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Desktop 4.29.0 (145265)
 Engine:
  Version:          26.0.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       8b79278
  Built:            Wed Mar 20 15:18:01 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

anybody know why this could be or how to problem solve.

thanks

1 Like

I have the same issue. While running the command “docker init” works locally in my machine, inside dev container, it doesn’t. I tried it in both docker-in-docker and docker-outside-docker and got the same error message.
Running “docker -v” shows the following versions:

  • Local machine Docker version 28.0.1
  • Dev Container Docker version 27.5.1-1

Docker init is only available in Docker Desktop. It is a docker cli plugin bundled with Docker Desktop. It can not be downloaded separately. A docker cli inside a container can not access the plugins of the Docker Desktop host (how would that even work on Mac and Windows?).

On a Linux host, I can imagine that it could be worth trying to bind the cli-plugin folder (docker info will show the actual location) into the docker-cli container’s plugin folder. There is no guarantee that it works, but it might be still worth trying.

2 Likes