Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
socat daemon on OSX for Docker
#!/bin/bash
#brew install socat
# socat TCP-LISTEN:2377,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock
#file: docker.socat_listener
# <?xml version="1.0" encoding="UTF-8"?>
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
# <plist version="1.0">
# <dict>
# <key>Label</key>
# <string>docker.socat_listener</string>
# <key>Disabled</key>
# <false/>
# <key>RunAtLoad</key>
# <true/>
# <key>KeepAlive</key>
# <true/>
# <key>ProgramArguments</key>
# <array>
# <string>/usr/local/bin/socat</string>
# <string>-d</string>
# <string>TCP-LISTEN:2377,reuseaddr,fork</string>
# <string>UNIX:/var/run/docker.sock</string>
# </array>
# <key>StandardErrorPath</key>
# <string>/Library/Logs/socat_docker.log</string>
# <key>StandardOutPath</key>
# <string>/Library/Logs/socat_docker.log</string>
# <key>StartInterval</key>
# <integer>30</integer>
# </dict>
# </plist>
# copy plist file to LaunchDaemons folder
#cd /Library/LaunchDaemons
#sudo chown root:wheel docker.socat_listener.plist
#sudo launchctl load se.ivankrizsan.socat_launcher.plist
# verify service with url: http://127.0.0.1:2377/version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment