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
When mounting a directory containing unix sockets the sockets should function the same as they do on a Linux host.
Actual behavior
The socket is 'there', but non-functional.
Information
After reading several forum threads, it appears that there is a workaround with socat over TCP, but this is rather slow.
The documentation has this to say: 'Socket files and named pipes only transmit between containers and between OS X processes -- no transmission across the hypervisor is supported, yet'
Hopefully this is a planned feature already, but I did not see any existing issues open in this tracker for this particular issue, although it relates to #410 which asks specifically for SSH_AUTH_SOCK to be supported.
Host OS: Mac OSX 10.10.5
Steps to reproduce the behavior
mount a directory containing unix sockets like so: '-v "/directorywithsockets:/otherdirectory"'
attempt to send data to/from the host/container via the socket
Reacted by Miguel Angel Guillén, Christian Winther, Felix Seidel, Lachlan Donald, James Beavers, Jonathan Sabo, Dan Farrell, Frank Kleine, AlexanderAllen, Ryan Parrish and 199 more
Reacted by Simon Weil, Andre Parmeggiani and Soheil Alizadeh
Reacted by Flip Hess, Piotr Kowalczyk, David Davtian, Marc Tamsky, Matt Callaway, Gerardo Lima, Kristijan Sedlak, Julien Lehuen, Connor Clark and Mike Marcacci
Our goal is to ship it in beta builds in November.
@dsheets That statement makes me think the work for this is already underway. However, the status label is still "1-acknowledged". Is this currently being worked on, or still on the todo list?
Most people will only want unix sockets for ssh agent forwarding
Most, but certainly not all.
The main issue for my personal use case is that I don't want ports exposed on the host. Instead, I would like a container port to be exposed on a UNIX socket and then use nginx to forward that UNIX socket to a certain hostname:
Why not publish the ports bound to only 127.0.0.1 ?
(I haven't personally tested with 127.0.0.1, but I do run a few dockers with their ports published to an alias 10.x.x.x address I've assigned to the localhost interface)
I definitely see another use case with $HOME/.gnupg/S.gpg-agent* sockets:
Building software inside a Docker container, and GPG signing the resulting build artifacts with a Yubikey plugged into the host OS. For example: Building a Debian package withdebuild + export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-sa -k${DEBSIGN_KEYID}"
This would need access to the gpg-agent socket for signing the package & .dsc, .changes, and .buildinfo files.
Reacted by Jean-Sebastien A. Beaudry, joe miller and Peter Willis
This is indeed very much needed in order to securely use GPG within Docker. GnuPG gpg-agent offers an extra domain socket which you can forward from the host to your container and hence use GPG inside the container. Lot's of stuff (e.g. pass or gopass, password manager) integrates with GPG so this isn't an exotic use case IMHO.
Since SSH forwarding works now, what would it take to make this work for GPG?
I am not sure I understand one thing: /var/run/docker.sock is a socket, right? and that one socket can be mounted in the containers, arbitrarily deep. Is that a special case that is different from user-created sockets?
Sorry to disappoint everyone, but I'm closing this ticket as "Won't Fix". The main use case has been solved in #410. As described in recent comments, the general case is too hard / impossible, and is realistically never going to be done.
Reacted by Rodrigo, Jivan Pal, ryche, Valentin Semirulnik, Rob Luke, Artem Gorev, arxra and Michail Guzhuman
It's still in the product at the moment, but is being replaced because of a lot of problems with it, particularly high CPU usage. There is no intent to open source it.
Activity
dsheets commentedon Sep 1, 2016
This is on the roadmap.
udondan commentedon Sep 19, 2016
Interestingly, even a socket created in the container is non-functional if it was created on a mounted volume of the host.
jippi commentedon Oct 15, 2016
Any ETA on this? :)
Currently it's blocking hashicorp/nomad#1091 and other projects :)
dsheets commentedon Oct 15, 2016
This is currently scheduled for resolution in November. Sorry for the delay.
jippi commentedon Oct 15, 2016
@dsheets okay, will it be available in beta builds beforehand?
dsheets commentedon Oct 15, 2016
Our goal is to ship it in beta builds in November.
jippi commentedon Oct 15, 2016
amazing @dsheets - if you need any testing or otherwise beforehand, I'm willing to help out!
Druotic commentedon Oct 28, 2016
@dsheets That statement makes me think the work for this is already underway. However, the status label is still "1-acknowledged". Is this currently being worked on, or still on the todo list?
BlinkyStitt commentedon Nov 9, 2016
We are in November now :) Any guess when this will be in Beta? This feature blocks a lot for us.
Druotic commentedon Nov 16, 2016
Any updates? Even a mention that this feature has been abandoned would be better than nothing.
124 remaining items
unilynx commentedon Jun 7, 2020
Why not publish the ports bound to only 127.0.0.1 ?
(I haven't personally tested with 127.0.0.1, but I do run a few dockers with their ports published to an alias 10.x.x.x address I've assigned to the localhost interface)
dancojocaru2000 commentedon Jun 7, 2020
The port would still be bounded.
Still, haven't thought about that approach! Thanks for reminding me I can probably do that!
benlangfeld commentedon Jun 7, 2020
Your nginx instance would have interfaces on both the overlay and the external networks.
trinitronx commentedon Jun 22, 2020
I definitely see another use case with
$HOME/.gnupg/S.gpg-agent*sockets:Building software inside a Docker container, and GPG signing the resulting build artifacts with a Yubikey plugged into the host OS. For example: Building a Debian package with
debuild+export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-sa -k${DEBSIGN_KEYID}"This would need access to the
gpg-agentsocket for signing the package &.dsc,.changes, and.buildinfofiles.rkettelerij commentedon Dec 9, 2020
This is indeed very much needed in order to securely use GPG within Docker. GnuPG
gpg-agentoffers an extra domain socket which you can forward from the host to your container and hence use GPG inside the container. Lot's of stuff (e.g. pass or gopass, password manager) integrates with GPG so this isn't an exotic use case IMHO.Since SSH forwarding works now, what would it take to make this work for GPG?
AndreaCensi commentedon Dec 20, 2020
I am not sure I understand one thing:
/var/run/docker.sockis a socket, right? and that one socket can be mounted in the containers, arbitrarily deep. Is that a special case that is different from user-created sockets?Failed experiment with unix socket
stephen-turner commentedon Jan 12, 2021
Sorry to disappoint everyone, but I'm closing this ticket as "Won't Fix". The main use case has been solved in #410. As described in recent comments, the general case is too hard / impossible, and is realistically never going to be done.
Vanuan commentedon Jan 13, 2021
@stephen-turner what's the current state of osxfs? Is it stiil being used? There's been a talk about open sourcing it several years ago.
stephen-turner commentedon Jan 14, 2021
It's still in the product at the moment, but is being replaced because of a lot of problems with it, particularly high CPU usage. There is no intent to open source it.
docker-robott commentedon Feb 13, 2021
Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked
djs55 commentedon Aug 17, 2026
For anyone still waiting on this, try the latest Docker 4.87, ensure you're using Docker VMM:
Ensure you have the system process
com.docker.sailorrunning (otherwise the feature flag might not be enabled -- try restarting to see if it syncs):and then AF_UNIX sockets should work over
docker run -v. Let me know if you hit issues: open a new issue with a repro case and ping me.