Skip to content

Instantly share code, notes, and snippets.

@michaelkebe
Last active September 8, 2023 11:09
Show Gist options
  • Save michaelkebe/a1fd64c5d31aaca5b092aa2b7409bf6d to your computer and use it in GitHub Desktop.
Save michaelkebe/a1fd64c5d31aaca5b092aa2b7409bf6d to your computer and use it in GitHub Desktop.
version: '3'
services:
dockersockwatcher:
build: .
tty: true
stdin_open: true
# WORKING
volumes:
- "/var/run:/var/run:ro"
# NOT WORKING
#volumes:
# - "/var/run/docker.sock:/var/run/docker.sock:ro"
GET /info HTTP/1.1
Host: localhost
FROM ubuntu
RUN apt-get update && apt-get install -y netcat-openbsd
COPY ./docker-sock-info /
COPY ./watcher.sh /
RUN chmod +x /watcher.sh
CMD /watcher.sh
#/bin/bash
watch "nc -q 0 -U /var/run/docker.sock < docker-sock-info"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment