dotfiles/.local/bin/ddev
2025-06-17 05:13:23 +00:00

34 lines
551 B
Bash
Executable File

#!/bin/bash
dkr() {
local ep="$1"; shift
(set -x
podman run --rm -it -v "$PWD:/mnt/" -w /mnt/ --entrypoint "$ep" \
"$img" "$@"
)
}
declare -A aliases=(
[arch]=quay.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
dkr bash "$@"
if [ "$?" = 127 ]; then
dkr sh "$@"
fi