To answer your exact question, we can see when inspecting your image (docker inspect nicolaka/netshoot:latest
) that there is no WorkingDir
defined. In this case, the default dir is /
(see What's the default WORKDIR in docker?). But you have to understand that this is the directory inside the running container, not the directory on your host machine.
Note that the command you used (i.e. docker inspect some-mongo
) is not inspecting your actual image/container but the one your have chosen as a base to attach your network.
If I understand well, your file is in your current dir on your local command line. To do what you want, you need to make the mypcap.pcap
file available to your container.
There are basically 2 ways to do this depending on your requirements.
Build an extended image
The idea is to extend your base image by copying the file inside it. You will need a Dockerfile for that
FROM nicolaka/netshoot:latest
COPY mypcap.pcap .
Then build the image
docker build . -t myextendedimage:mytag
And launch a container based on the new image
docker run -it --net container:some-mongo myextendedimage:mytag tcpdump -qns 0 -X -r mypcap.pcap
Bind mount your file in your container
In your situation this would probably be my preferred option. Assuming that your pcap file is located in C:\tmp\mypcap.pcap
docker run -it --net container:some-mongo -v C:\tmp\mypcap.pcap:/mypcap.pcap nicolaka/netshoot tcpdump -qns 0 -X -r mypcap.pcap
Note that you can mount this file in the image anywhere you like:
docker run -it --net container:some-mongo -v C:\tmp\mypcap.pcap:/my/random/dir/mypcap.pcap nicolaka/netshoot tcpdump -qns 0 -X -r mypcap.pcap