Skip to content

Instantly share code, notes, and snippets.

@sl33nyc
Created September 3, 2022 14:01
Show Gist options
  • Save sl33nyc/80393625c3a45026df024c3167091c77 to your computer and use it in GitHub Desktop.
Save sl33nyc/80393625c3a45026df024c3167091c77 to your computer and use it in GitHub Desktop.
# inspired by https://gist.github.com/ljjjustin/585e817d1d7ce4eb75b87076e5b7aa7e
brew install socat
socat -d -d -d -lf ns-socat.log TCP-LISTEN:12345,reuseaddr,fork UNIX-CLIENT:$HOME/.docker/run/docker.sock
docker run -d --name service --rm alpine /bin/sh -c "apk add --no-cache docker-cli socat && socat -d -d -d -lf socat.log UNIX-LISTEN:/var/run/docker.sock,reuseaddr,fork TCP:host.docker.internal:12345"
docker exec service /bin/sh -c "/usr/bin/docker ps"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f95c69905309 alpine "/bin/sh -c 'apk add…" 9 seconds ago Up 8 seconds service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment