Container may be used in to record other container network traffic.
docker pull safarov/dumpcap
docker run -itd --name dumpcap --net=container:${CONTAINER_NAME} safarov/dumpcap
Run as systemd unit
systemctl add-requires [email protected] parent-docker.service
systemctl enable --now [email protected]
git clone https://github.com/safarov/dockerfiles; cd dockerfiles/dumpcap/alpine
docker build --tag="dumpcap:local" ./
docker run --net=container:${CONTAINER_NAME} -t -i dumpcap:local
captagent:
container_name: dumpcap
image: safarov/dumpcap
restart: always
net: container:${CONTAINER_NAME}
Unit filename [email protected]
[Unit]
Description=dumpcap container template
After=docker.service network-online.target
Requires=docker.service
[Service]
Restart=always
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker rm -f dumpcap-%i
;Space symbol must be escaped https://www.freedesktop.org/software/systemd/man/systemd-escape.html
ExecStart=/usr/bin/docker run -t \
--rm=true \
--name=dumpcap-%i \
--network=container:%i \
-w="/dumpcap/%i" \
-v dumpcap:/dumpcap \
safarov/dumpcap
ExecStop=/usr/bin/docker stop dumpcap-%i
[Install]
WantedBy=multi-user.target
Content type
Image
Digest
sha256:0802d692d…
Size
2.3 MB
Last updated
5 days ago
docker pull safarov/dumpcap