You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been searching for several hours and ran through many -v commands on how to mount or bind the host's docker command inside a container so that the container can have access to the docker command.
I have checked this closed issue, but the solution commented on Oct 2, 2019, doesn't work for me: #4642
Searching online, you will find various answers like:
Just run -v //var/run/docker.sock:/var/run/docker.sock
But none of this works for my ubuntu container. I have Docker Desktop version 4.30.0 on Windows 11 with WSL 2, and I have tried ubuntu 22.04 and 24.04 container images. Would be helpful if there was actually official documentation somewhere detailing how to connect to the host's docker instance (which I can't find).
Reproduce
docker run -v /usr/local/bin/docker:/usr/bin/docker -it <repo>/<image>
Run docker command docker version and get
bash: docker: command not found
The bound volume when you check /usr/bin/docker is actually just an empty folder.
Expected behavior
Command used to just work in giving access to host's docker command inside docker container, as described in this solution: #4642 (comment)
Description
I have been searching for several hours and ran through many
-v
commands on how to mount or bind the host'sdocker
command inside a container so that the container can have access to the docker command.I have checked this closed issue, but the solution commented on Oct 2, 2019, doesn't work for me:
#4642
Searching online, you will find various answers like:
Sources:
https://stackoverflow.com/questions/36765138/bind-to-docker-socket-on-windows
https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/
But none of this works for my
ubuntu
container. I have Docker Desktop version 4.30.0 on Windows 11 with WSL 2, and I have triedubuntu
22.04 and 24.04 container images. Would be helpful if there was actually official documentation somewhere detailing how to connect to the host's docker instance (which I can't find).Reproduce
docker run -v /usr/local/bin/docker:/usr/bin/docker -it <repo>/<image>
docker version
and get/usr/bin/docker
is actually just an empty folder.Expected behavior
Command used to just work in giving access to host's docker command inside docker container, as described in this solution:
#4642 (comment)
docker version
Client: Cloud integration: v1.0.35+desktop.13 Version: 26.1.1 API version: 1.45 Go version: go1.21.9 Git commit: 4cf5afa Built: Tue Apr 30 11:48:43 2024 OS/Arch: windows/amd64 Context: default Server: Docker Desktop 4.30.0 (149282) Engine: Version: 26.1.1 API version: 1.45 (minimum version 1.24) Go version: go1.21.9 Git commit: ac2de55 Built: Tue Apr 30 11:48:28 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.31 GitCommit: e377cd56a71523140ca6ae87e30244719194a521 runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Diagnostics ID
7649BA3E-A3D0-45FE-9AF4-FA3C03C9B024/20240515024124
Additional Info
No response
The text was updated successfully, but these errors were encountered: