Skip to content

Docker container sending messages to the host computer over Unix domain socket connection

License

Notifications You must be signed in to change notification settings

TannerSorensen/Docker_Unix_Socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker with Unix Sockets

This is a minimal working example of a Docker container sending messages to the host computer over a Unix socket connection.

After installing Docker, build the Docker image with the following commands, where <name> is the name of the container.

docker build -t <name> .

Start the Python server on the host machine with the following command.

python3 server.py

While the server.py Python process is running, run client.py in the Docker image with the following command, where <image> is the image ID.

docker run -v /tmp:/tmp <image>