Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Commit

Permalink
Add ignoreeof flag to socat tcp listener (#22)
Browse files Browse the repository at this point in the history
After a maddening few hours of using `socat` as a proxy to the docker socket and wondering why `docker run` would inconsistently fail to return any output I found it was due to the unfortunate behaviour of `socat` and the `docker` cli. I believe that the docker client is leaving the socket half-open which triggers socat to timeout (after 0.5s by default) if there is no data to read from the opposite direction. Increasing the timeout (`socat -t10`) worked but ignoring the EOF entirely seems more robust.
  • Loading branch information
TimeToogo committed Nov 9, 2022
1 parent ba80fda commit b7bc1f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ docker run -d --restart=always \
-p 127.0.0.1:2376:2375 \
-v /var/run/docker.sock:/var/run/docker.sock \
alpine/socat \
tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
tcp-listen:2375,fork,reuseaddr,ignoreeof unix-connect:/var/run/docker.sock
```

***WARNING***: The Docker API is insecure by default. Please remember to bind the TCP socket to the `localhost` interface otherwise the Docker API will be bound to all interfaces.
Expand Down

0 comments on commit b7bc1f1

Please sign in to comment.