Skip to content

Instantly share code, notes, and snippets.

@matzew
Created September 15, 2016 11:14
Show Gist options
  • Save matzew/cc11a73f611f66710a5cb33494b12f5d to your computer and use it in GitHub Desktop.
Save matzew/cc11a73f611f66710a5cb33494b12f5d to your computer and use it in GitHub Desktop.

Connecting to the Docker Remote API, on a Mac, via WebSocket

After searching I found the bobrik/socat image, after searching the Docker Forum for Mac and WebSocket Remote API access. This thread was helpful!

Now, I did install wscat, which is a nice Node CLI for WebSocket, and I could attach my wscat to the docker container stream, via WebSocket:

wscat --origin http://localhost --connect ws://localhost:2376/containers/ee09c572f5ed/attach/ws?logs\=1\&stdin\=1\&stderr\=1\&stdout\=1\&stream\=1

In this case I got the log output of a Redis container!

This page shows details on the Docker Remote/Websocket API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment