This example runs tcpdump in a container. You may need --net=host and elevated privileges.
See Docker installation: Docker
docker run --rm -it --net=host --cap-add=NET_ADMIN --cap-add=NET_RAW ubuntu:24.04 bash -lc "apt-get update && apt-get install -y tcpdump && tcpdump -n -i any -c 10"