3 ms·
In such a crisis if installing tools is impossible, you can run many utils via Docker, such as: Build a container with a one-liner: docker build -t tcpdump -
by reilly3000 3y ago
In such a crisis if installing tools is impossible, you can run many utils via Docker, such as:
Build a container with a one-liner:
docker build -t tcpdump - <<EOF \nFROM ubuntu \nRUN apt-get update && apt-get install -y tcpdump \nCMD tcpdump -i eth0 \nEOF
Run attached to the host network:
docker run -dP --net=host moremagic/docker-netstat
Run system tools attached to read host processes:
for sysstat_tool in iostat sar vmstat mpstat pidstat; do
alias "sysstat-${sysstat_tool}=docker run --rm -it -v /proc:/proc --privileged --net host --pid host ghcr.io/krishjainx/sysstat-docker:main /usr/bin/${sysstat_tool}"
done
unset -v sysstat_tool
Sure, yum install is preferred, but so long as docker is available this is a viable alternative if you can manage the extra mapping needed. It probably wouldn’t work with a rootless/podman setup.
- blueflow 3y agoIs there a situation where apt cant download and install packages but docker can fetch new containers? apt libs borked or something?
- Smar 3y agoI would just decompress the .deb in such case. As a last resort, even a .rpm might work. Of course handling dependencies by hand is annoying, but depending on situation it might be faster anyway.
- xyst 3y agoUnless you are in an air gapped situation. Good luck pulling “Ubuntu” image!
- supriyo-biswas 3y agoOn that note I'd largely prefer if `busybox` contained more of these tools, it'd be very helpful to have a 1MBish file that I can upload into a server and run it there.