My Scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bin/box

16 lines
388 B

#!/usr/bin/env bash
# Start a temporary sandbox
# Usage: box [image]
# detect contd
contd=$(command -v podman) # Use podman by default
image="${1:-alpine}"
if [ -z "$contd" ]
then
contd=$(command -v docker)
[ -z "$contd" ] && { echo 'Please install podman/docker'; return 1; }
[ ! "$(whoami)" = root ] && contd="sudo $contd"
fi
$contd run -it --name=sandbox --rm "$image:latest" sh