Compare commits
No commits in common. "cc4ae5b1176aa6859d085bbd03e743af57f3c5f4" and "f4d009c6238d81525c2badf830250bbd6bea0cd4" have entirely different histories.
cc4ae5b117
...
f4d009c623
10
.build.yml
10
.build.yml
@ -1,4 +1,4 @@
|
|||||||
image: alpine/latest
|
image: alpine/edge
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
- 0ee986ff-5686-43cd-ac3a-1fe5b2e5dd8f
|
- 0ee986ff-5686-43cd-ac3a-1fe5b2e5dd8f
|
||||||
@ -6,7 +6,7 @@ secrets:
|
|||||||
- 130adee5-3a8f-4035-8cad-e3d044be2961
|
- 130adee5-3a8f-4035-8cad-e3d044be2961
|
||||||
|
|
||||||
sources:
|
sources:
|
||||||
- https://git.sr.ht/~jswank/alpine-cli#3
|
- https://git.sr.ht/~jswank/alpine-cli
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- podman
|
- podman
|
||||||
@ -24,7 +24,6 @@ tasks:
|
|||||||
- build: |
|
- build: |
|
||||||
cd alpine-cli
|
cd alpine-cli
|
||||||
sudo --preserve-env just build
|
sudo --preserve-env just build
|
||||||
# sudo --preserve-env go-task build
|
|
||||||
|
|
||||||
# publish the image using the just recipe
|
# publish the image using the just recipe
|
||||||
# - set environment variables from the ~/.envdir directory. see
|
# - set environment variables from the ~/.envdir directory. see
|
||||||
@ -34,6 +33,5 @@ tasks:
|
|||||||
- publish: |
|
- publish: |
|
||||||
cd alpine-cli
|
cd alpine-cli
|
||||||
chpst -e ~/.envdir sudo --preserve-env just registry_pass_var=GH_PAT publish
|
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=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=quay.io registry_pass_var=QUAY_PAT publish
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
FROM docker.io/library/alpine:3
|
FROM docker.io/library/alpine:latest
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title=jswank/alpine-cli \
|
LABEL org.opencontainers.image.title=jswank/alpine-cli \
|
||||||
org.opencontainers.image.description="A minimal image for running Linux CLI utilities" \
|
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.authors="Jason Swank" \
|
||||||
org.opencontainers.image.licenses=MIT
|
org.opencontainers.image.licenses=MIT
|
||||||
|
|
||||||
RUN apk --no-cache update
|
|
||||||
|
|
||||||
RUN apk -U --no-cache add \
|
RUN apk -U --no-cache add \
|
||||||
doas doas-sudo-shim \
|
doas doas-sudo-shim \
|
||||||
bash less openvi \
|
bash less openvi \
|
||||||
|
|||||||
@ -12,7 +12,7 @@ images.
|
|||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
```console
|
```console
|
||||||
$ docker run -ti --rm ghcr.io/jswank/alpine-cli
|
$ docker run -ti --rm ghcr.io/jswank/alpine-cli:3
|
||||||
~ $ ^D
|
~ $ ^D
|
||||||
exit
|
exit
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ exit
|
|||||||
|
|
||||||
Bonus - the same script could be used to start other containers:
|
Bonus - the same script could be used to start other containers:
|
||||||
```console
|
```console
|
||||||
$ bin/cli image=alpine:3
|
$ bin/cli image=alpine:latest
|
||||||
/ # ^D
|
/ # ^D
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
31
Taskfile.yml
31
Taskfile.yml
@ -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}}'
|
|
||||||
2
bin/cli
2
bin/cli
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env -S just --working-directory . --justfile
|
#!/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"
|
n := "alpine-cli"
|
||||||
|
|
||||||
# Invoke the 'run' recipe
|
# Invoke the 'run' recipe
|
||||||
|
|||||||
5
justfile
5
justfile
@ -11,11 +11,12 @@ registry_pass_var := "REGISTRY_PASSWORD"
|
|||||||
|
|
||||||
# build a new image
|
# build a new image
|
||||||
build flags="":
|
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 the image
|
||||||
publish alt_tag=tag:
|
publish alt_tag=tag:
|
||||||
@ podman tag {{image}}:{{tag}} {{registry}}/{{image}}:{{alt_tag}}
|
@ podman tag {{image}}:{{tag}} {{registry}}/{{image}}:{{alt_tag}}
|
||||||
@ echo "${{ registry_pass_var }}" | podman login {{registry}} -u {{registry_user}} --password-stdin
|
@ 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}}
|
@ podman logout {{registry}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user