Last active
January 25, 2023 09:03
-
-
Save djangofan/d202ff132ca72ba4918d60846ec1fe76 to your computer and use it in GitHub Desktop.
socat daemon on OSX for Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Solved the problem: I added the range-parameter to my socat arguments in launch daemon script. This leads to an error! Don't use the range-parameter in TCP-LISTEN on Mac OS!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I add this to my launch daemons I get a "connection refused" error after restart of my Mac Studio running on Mac OS Ventura 13.1
The error log: "2023/01/24 17:12:43 socat[346] W refusing connection from LEN=16 AF=2 192.168.178.XXX:48416 due to range option"
All is working fine if I start socat manually by "socat TCP-LISTEN:2375,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock &"
Any ideas?