#!/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 persistent 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}} {{image}}{ fi # remove the persistent image @clean: podman rm -f {{n}} >/dev/null 2>&1