DEPRECATED: Use the image from my dockerfiles
repo instead: https://github.com/MaxMilton/dockerfiles/tree/master/net-tools
A collection of Linux network tools in a docker container. No mater what host system you're using, have a consistent CLI experience.
Build locally (better if you want to customise the image but remember to rebuild periodically for updates):
docker build --no-cache -t local/net-tools .
Or use a prebuilt image:
docker pull maxmilton/net-tools
TIP: Change
local/net-tools
tomaxmilton/net-tools
if you use the prebuilt image.
For fish shell run these commands or add them to a one-time config file:
abbr --add nt 'docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools'
abbr --add curl 'docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools curl'
abbr --add drill 'docker run -ti --rm local/net-tools drill'
abbr --add htop 'docker run -ti --rm --pid=host local/net-tools htop'
abbr --add iperf 'docker run -ti --rm --network=host local/net-tools iperf'
abbr --add jq 'docker run -ti --rm --volume="$PWD":/data local/net-tools jq'
abbr --add mtr 'docker run -ti --rm local/net-tools mtr'
abbr --add nmap 'docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools nmap'
abbr --add ncat 'docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools ncat'
abbr --add nping 'docker run -ti --rm --network=host local/net-tools nping'
abbr --add ssh 'docker run -ti --rm --network=host --volume="$HOME"/.ssh:/root/.ssh:ro --volume="$PWD":/data local/net-tools ssh'
abbr --add sftp 'docker run -ti --rm --network=host --volume="$HOME"/.ssh:/root/.ssh:ro --volume="$PWD":/data local/net-tools sftp'
abbr --add scp 'docker run -ti --rm --network=host --volume="$HOME"/.ssh:/root/.ssh:ro --volume="$PWD":/data local/net-tools scp'
abbr --add tcpdump 'docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools tcpdump'
abbr --add whois 'docker run -ti --rm local/net-tools whois'
Bash/ZSH shell version; put this in your .bashrc
or .zshrc
:
alias nt='docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools'
alias curl='docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools curl'
alias drill='docker run -ti --rm local/net-tools drill'
alias htop='docker run -ti --rm --pid=host local/net-tools htop'
alias iperf='docker run -ti --rm --network=host local/net-tools iperf'
alias jq='docker run -ti --rm --volume="$PWD":/data local/net-tools jq'
alias mtr='docker run -ti --rm local/net-tools mtr'
alias nmap='docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools nmap'
alias ncat='docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools ncat'
alias nping='docker run -ti --rm --network=host local/net-tools nping'
alias ssh='docker run -ti --rm --network=host --volume="$HOME"/.ssh:/root/.ssh:ro --volume="$PWD":/data local/net-tools ssh'
alias sftp='docker run -ti --rm --network=host --volume="$HOME"/.ssh:/root/.ssh:ro --volume="$PWD":/data local/net-tools sftp'
alias scp='docker run -ti --rm --network=host --volume="$HOME"/.ssh:/root/.ssh:ro --volume="$PWD":/data local/net-tools scp'
alias tcpdump='docker run -ti --rm --network=host --volume="$PWD":/data local/net-tools tcpdump'
alias whois='docker run -ti --rm local/net-tools whois'
Released under the MIT licence; see LICENCE.
© 2018 Max Milton