1.Build an image
docker run -it --name=alpine alpine:3.9.2
apk add tcpdump
docker commit alpine aaa:tag
2. Grab tcpdump
"docker ps | grep your service" to get all of the container
"docker run -it --rm --net=container:containerID aaa:tag"
"tcpdump -i lo -w lo.pcap"
3. How to copy lo.pcap file to container .
"docker volume create data" to create a volume name is data.
"docker inspect data" to view detailed message .
"docker run -it --rm --net=container:containerID --mount source=data,destination=/dir aaa:tag"