Added sandbox script

master
Stephen Cochrane 2 years ago
parent 38ce334f4b
commit c328065251
  1. 16
      box

16
box

@ -0,0 +1,16 @@
#!/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
Loading…
Cancel
Save