Last active
September 8, 2023 11:09
-
-
Save michaelkebe/a1fd64c5d31aaca5b092aa2b7409bf6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /info HTTP/1.1 | |
Host: localhost | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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