diff --git a/.build.yml b/.build.yml index 45b091d..c794ef9 100644 --- a/.build.yml +++ b/.build.yml @@ -7,7 +7,7 @@ sources: - https://git.sr.ht/~jswank/alpine-cli packages: - - docker + - podman - just - runit diff --git a/justfile b/justfile index 4374c1e..5da0c65 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,7 @@ set dotenv-load image := "ghcr.io/jswank/alpine-cli:latest" +n := "alpine-cli" # get a bash shell on a temporary container using {{image}} all: run @@ -9,11 +10,27 @@ all: run run: @ docker run -ti --rm {{image}} +# run (or attach to) a perisent container {{n}} +persist: + #!/bin/sh + already_running=$(docker ps --all --filter name={{n}} --format=json | wc -l ) + if [[ $already_running -gt 0 ]]; then + docker start -i {{n}} + else + docker run -ti --name {{n}} {{image}} + fi + +# remove the persistent image +clean: + @ docker rm -f {{n}} >/dev/null 2>&1 + # build a new image build: - docker build -t {{image}} -f Dockerfile ./ctx + sudo podman build -t {{image}} -f Dockerfile ./ctx + +# publish the image +publish: + @ echo $GH_PAT | sudo docker login ghcr.io -u jswank --password-stdin >/dev/null 2>&1 + sudo docker push {{image}} + @ sudo docker logout ghcr.io -publish: - @ echo $GH_PAT | docker login ghcr.io -u jswank --password-stdin >/dev/null 2>&1 - docker push {{image}} - @ docker logout ghcr.io