问题
I'm trying to investigate a network issue and would like to install tcpdump / tshark.
What package manager does minikube use? How can I install tcpdump?
回答1:
It is not an easy task.
Minikube VM is based on Buildroot distribution.
Usually minikube uses docker to build a buildroot image, but you can clone buildroot repo and configure it to include tcpdump package using specific targets (make iso-minikube, make iso-menuconfig).
Then you need to build a minikube image and run minikube using that image.
The manual is not full, but gives you the main idea of what to do.
Alternatively you may try to copy tcpdump
and all its dependencies to minikube VM using scp
.
回答2:
Probably the fastest way is using static tcpdump binary.
You can run this on minikube
curl https://raw.githubusercontent.com/yunchih/static-binaries/master/tcpdump -o tcpdump
chmod +x ./tcpdump
And now you can use it as a regular tcpdump
sudo ./tcpdump ...
PS. I don't recommend using random binaries from internet due to security reasons.
Preferably, compile it yourself from source as a static binary and then use it.
来源:https://stackoverflow.com/questions/54747069/how-can-i-install-use-tcpdump-on-minikube