diff options
author | Jesse Luehrs <doy@tozt.net> | 2024-02-12 03:33:46 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2024-02-12 03:33:46 -0500 |
commit | da20ca3a6f90b64e82f7873c432f01164816ac6e (patch) | |
tree | a8ba22567af27b34e9eb1114c4c76f178fdc82ac /local/.bin/smt | |
parent | 81bc45debcd734d60581fd6ed420fdb50990e19e (diff) | |
download | conf-da20ca3a6f90b64e82f7873c432f01164816ac6e.tar.gz conf-da20ca3a6f90b64e82f7873c432f01164816ac6e.zip |
improve the podman wrapper scripts
Diffstat (limited to 'local/.bin/smt')
-rwxr-xr-x | local/.bin/smt | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/local/.bin/smt b/local/.bin/smt index ad3f459..446197d 100755 --- a/local/.bin/smt +++ b/local/.bin/smt @@ -1,9 +1,22 @@ #!/bin/sh set -eu -podman images | grep -q localhost/smt || cat <<EOF | podman build -t smt -f - -FROM docker.io/alpine:latest -RUN apk add perl make -RUN env PERL_MM_USE_DEFAULT=1 perl -MCPAN -e'install Games::SMTNocturne::Demons' +DOCKERFILE="$(cat <<EOF +FROM docker.io/debian:stable-slim +RUN apt-get update && apt-get install -y --no-install-recommends \ + cpanminus \ + make \ + gcc \ + libreadline-dev +RUN cpanm -n Games::SMTNocturne::Demons EOF -podman run --rm smt smt "$@" +)" +IMAGE="$(basename "$0"):$(echo "$DOCKERFILE" | sha256sum | cut -d' ' -f1)" + +if [ -z "$(podman images -q "$IMAGE")" ]; then + echo "$DOCKERFILE" | podman build -t "$IMAGE" -f - . +fi + +podman run --rm -it \ + "$IMAGE" \ + smt "$@" |