alpine-cli/justfile
2023-05-08 21:56:19 -04:00

23 lines
592 B
Makefile

set dotenv-load
tag := `grep ^FROM Dockerfile | cut -d: -f2`
image := "jswank/alpine-cli:" + tag
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:
podman build -t {{image}} -f Dockerfile ctx
# publish the image
publish:
@ podman tag {{image}} {{registry}}/{{image}}
@ echo "${{ registry_pass_var }}" | podman login {{registry}} -u {{registry_user}} --password-stdin
@ podman push {{registry}}/{{image}}
@ podman logout {{registry}}