2025-07-14 21:08:39 -04:00

26 lines
433 B
Bash
Executable File

#!/bin/bash
# Start a docker netshoot container
set -eu
main ()
{
local container=${1-}
local img=${2:-nicolaka/netshoot}
local args=
local opts=
if [[ -n "$container" ]]; then
opts="--network container:$container"
fi
if [[ "$container" == "$img" ]]; then
img=$(docker inspect --format='{{.Image}}' "$container")
fi
docker run --rm -ti -v "$HOME/.cache/netshoot:/root" $opts $img /bin/bash
}
main $@