there's something I'm not getting from the new docker compose configuration file:
here's my Dockerfile:
FROM ubuntu
run apt-get update && \
apt-get install -y netcat net-tools tcpdump
CMD tcpdump -i eth0 -XX
here's my docker-compose.yml
:
version: '3.7'
services:
server:
build: ./
image: srv
container_name: srv
client:
build: ./
image: clnt
container_name: clnt
I open three consoles:
%1 docker-compose up --force-recreate --build
builds and starts showing network traffic
%2 docker exec -it srv /bin/bash
%2 nc -lp 4001 &
%3 docker exec -it clnt /bin/bash
%3 nc srv 4001
I can see messages being shared back and forth between the two containers, but tcpdump doesn't report any of these messages, is not docker using eth0 for these connections?
I'm confused.