convert to podman
This commit is contained in:
parent
2e29897aab
commit
85e9bcfdb7
@ -7,7 +7,7 @@ sources:
|
|||||||
- https://git.sr.ht/~jswank/alpine-cli
|
- https://git.sr.ht/~jswank/alpine-cli
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- docker
|
- podman
|
||||||
- just
|
- just
|
||||||
- runit
|
- runit
|
||||||
|
|
||||||
|
|||||||
27
justfile
27
justfile
@ -1,6 +1,7 @@
|
|||||||
set dotenv-load
|
set dotenv-load
|
||||||
|
|
||||||
image := "ghcr.io/jswank/alpine-cli:latest"
|
image := "ghcr.io/jswank/alpine-cli:latest"
|
||||||
|
n := "alpine-cli"
|
||||||
|
|
||||||
# get a bash shell on a temporary container using {{image}}
|
# get a bash shell on a temporary container using {{image}}
|
||||||
all: run
|
all: run
|
||||||
@ -9,11 +10,27 @@ all: run
|
|||||||
run:
|
run:
|
||||||
@ docker run -ti --rm {{image}}
|
@ 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 a new image
|
||||||
build:
|
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
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user