Skip to content

Instantly share code, notes, and snippets.

@marcingrzejszczak
Created February 9, 2016 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcingrzejszczak/add8232542ac571c517e to your computer and use it in GitHub Desktop.
Save marcingrzejszczak/add8232542ac571c517e to your computer and use it in GitHub Desktop.
When docker suddenly stops working via tcp...
#Enable the Remote API on a New Socket
# create file to make Docker available on a TCP socket on port 2375.
touch /etc/systemd/system/docker-tcp.socket
cat > /etc/systemd/system/docker-tcp.socket <<EOF
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
BindIPv6Only=both
Service=docker.service
[Install]
WantedBy=sockets.target
EOF
# Then enable this new socket:
systemctl enable docker-tcp.socket
systemctl stop docker
systemctl start docker-tcp.socket
systemctl start docker
# Test that it’s working:
docker -H tcp://127.0.0.1:2375 ps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment