Compare commits

..

No commits in common. "cc4ae5b1176aa6859d085bbd03e743af57f3c5f4" and "f4d009c6238d81525c2badf830250bbd6bea0cd4" have entirely different histories.

6 changed files with 12 additions and 46 deletions

View File

@ -1,4 +1,4 @@
image: alpine/latest
image: alpine/edge
secrets:
- 0ee986ff-5686-43cd-ac3a-1fe5b2e5dd8f
@ -6,7 +6,7 @@ secrets:
- 130adee5-3a8f-4035-8cad-e3d044be2961
sources:
- https://git.sr.ht/~jswank/alpine-cli#3
- https://git.sr.ht/~jswank/alpine-cli
packages:
- podman
@ -24,7 +24,6 @@ tasks:
- build: |
cd alpine-cli
sudo --preserve-env just build
# sudo --preserve-env go-task build
# publish the image using the just recipe
# - set environment variables from the ~/.envdir directory. see
@ -34,6 +33,5 @@ tasks:
- publish: |
cd alpine-cli
chpst -e ~/.envdir sudo --preserve-env just registry_pass_var=GH_PAT publish
# chpst -e ~/.envdir sudo --preserve-env go-task publish
# chpst -e ~/.envdir sudo --preserve-env just registry=docker.io registry_pass_var=DH_PAT publish
# chpst -e ~/.envdir sudo --preserve-env just registry=quay.io registry_pass_var=QUAY_PAT publish
chpst -e ~/.envdir sudo --preserve-env just registry=docker.io registry_pass_var=DH_PAT publish
chpst -e ~/.envdir sudo --preserve-env just registry=quay.io registry_pass_var=QUAY_PAT publish

View File

@ -1,4 +1,4 @@
FROM docker.io/library/alpine:3
FROM docker.io/library/alpine:latest
LABEL org.opencontainers.image.title=jswank/alpine-cli \
org.opencontainers.image.description="A minimal image for running Linux CLI utilities" \
@ -6,8 +6,6 @@ LABEL org.opencontainers.image.title=jswank/alpine-cli \
org.opencontainers.image.authors="Jason Swank" \
org.opencontainers.image.licenses=MIT
RUN apk --no-cache update
RUN apk -U --no-cache add \
doas doas-sudo-shim \
bash less openvi \

View File

@ -12,7 +12,7 @@ images.
## Quickstart
```console
$ docker run -ti --rm ghcr.io/jswank/alpine-cli
$ docker run -ti --rm ghcr.io/jswank/alpine-cli:3
~ $ ^D
exit
@ -76,7 +76,7 @@ exit
Bonus - the same script could be used to start other containers:
```console
$ bin/cli image=alpine:3
$ bin/cli image=alpine:latest
/ # ^D
```

View File

@ -1,31 +0,0 @@
version: '3'
env:
IMAGE: jswank/alpine-cli
NAME: alpine-cli
vars:
TAG:
sh: 'grep ^FROM Dockerfile | cut -d: -f2'
tasks:
default:
cmds:
- task: build
build:
desc: build a new image
cmds:
- (podman manifest exists {{.IMAGE}}:{{.TAG}} && podman manifest rm {{.IMAGE}}:{{.TAG}}) || true
- podman manifest create {{.IMAGE}}:{{.TAG}}
- podman build {{.CLI_ARGS}} --platform linux/amd64,linux/arm64 --manifest {{.IMAGE}}:{{.TAG}} {{.CLI_ARGS}} -f Dockerfile ctx
publish:
desc: publish the image
cmds:
- 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}}
vars:
REGISTRY_PASS_VAR: GH_PAT
REGISTRY: ghcr.io
REGISTRY_USER: jswank
ALT_TAG: '{{.TAG}}'

View File

@ -1,6 +1,6 @@
#!/usr/bin/env -S just --working-directory . --justfile
image := "ghcr.io/jswank/alpine-cli:3"
image := "ghcr.io/jswank/alpine-cli:edge"
n := "alpine-cli"
# Invoke the 'run' recipe

View File

@ -11,11 +11,12 @@ registry_pass_var := "REGISTRY_PASSWORD"
# build a new image
build flags="":
podman build -t {{image}}:{{tag}} {{flags}} -f Dockerfile ctx
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 push {{registry}}/{{image}}:{{alt_tag}}
@ podman manifest push {{registry}}/{{image}}:{{alt_tag}}
@ podman logout {{registry}}