alpine-cli/justfile
2024-05-01 14:47:42 -04:00

23 lines
750 B
Makefile

set dotenv-load
tag := `grep ^FROM Dockerfile | cut -d: -f2`
image := "jswank/alpine-cli"
registry := "ghcr.io"
registry_user := "jswank"
# this environment variable will be passed to podman login as the password
registry_pass_var := "REGISTRY_PASSWORD"
# build a new image
build flags="":
podman manifest create {{image}}:{{tag}}
podman build --platform linux/amd64,linux/arm64 --manifest {{image}}:{{tag}} {{flags}} -f Dockerfile ctx
# publish the image
publish alt_tag=tag:
@ podman tag {{image}}:{{tag}} {{registry}}/{{image}}:{{alt_tag}}
@ echo "${{ registry_pass_var }}" | podman login {{registry}} -u {{registry_user}} --password-stdin
@ podman manifest push {{registry}}/{{image}}:{{alt_tag}}
@ podman logout {{registry}}