This commit is contained in:
Jason Swank
2023-03-16 12:21:36 -04:00
parent c14c57e182
commit ac6aa468f5
5 changed files with 49 additions and 32 deletions

25
bin/cli Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env -S just --working-directory . --justfile
image := "ghcr.io/jswank/alpine-cli:latest"
n := "cli"
# run
default: run
# run a temporary container based on {{image}}
@run:
podman run -ti --rm {{image}}
# run (or attach to) a perisent container {{n}}
persist:
#!/bin/sh
if [ $(podman ps --all --filter name="{{n}}" -q | wc -l) -gt 0 ]; then
podman start -i -a {{n}}
else
podman run -ti --name {{n}} ghcr.io/jswank/alpine-cli:latest
fi
# remove the persistent image
clean:
@ podman rm -f {{n}} >/dev/null 2>&1