dotfiles/.local/bin/ddev
2024-12-27 11:43:30 +00:00

24 lines
418 B
Bash
Executable File

#!/bin/bash -e
declare -A aliases
aliases=(
[arch]=docker.io/archlinux/archlinux:base
[debian]=docker.io/debian:12-slim
[kaniko]=gcr.io/kaniko-project/executor:debug
)
if [ -z "$1" ]; then
exit 1
fi
if [ -n "${aliases[$1]}" ]; then
img="${aliases[$1]}"
else
img="docker.io/$1"
[[ "$img" == *:* ]] || img+=:latest
fi
shift
set -x
podman run --rm -it -v "$PWD:/mnt/" -w /mnt/ "$img" "$@"