cleanup
This commit is contained in:
25
bin/cli
Executable file
25
bin/cli
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user