mirror of https://git.sr.ht/~skiqqy/bin
parent
38ce334f4b
commit
c328065251
@ -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…
Reference in new issue