Compare commits
19 Commits
f4d009c623
...
cc4ae5b117
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc4ae5b117 | ||
| bd2f8c93af | |||
| b509e04f46 | |||
| f42565d3e7 | |||
| f28f3e7a68 | |||
| 23719e952a | |||
| afe1b6175c | |||
| f43022c3e4 | |||
| 74c7f1af1b | |||
| 187efe30ae | |||
|
|
962c2a99d0 | ||
|
|
ecefaf21b8 | ||
|
|
e94d0c9bdb | ||
| abe50e0bff | |||
| 5eee531c76 | |||
| d9f04fda7a | |||
| 15148c2f2d | |||
| 69ed89d421 | |||
| ae5240316d |
10
.build.yml
10
.build.yml
@ -1,4 +1,4 @@
|
||||
image: alpine/edge
|
||||
image: alpine/latest
|
||||
|
||||
secrets:
|
||||
- 0ee986ff-5686-43cd-ac3a-1fe5b2e5dd8f
|
||||
@ -6,7 +6,7 @@ secrets:
|
||||
- 130adee5-3a8f-4035-8cad-e3d044be2961
|
||||
|
||||
sources:
|
||||
- https://git.sr.ht/~jswank/alpine-cli
|
||||
- https://git.sr.ht/~jswank/alpine-cli#3
|
||||
|
||||
packages:
|
||||
- podman
|
||||
@ -24,6 +24,7 @@ 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
|
||||
@ -33,5 +34,6 @@ tasks:
|
||||
- publish: |
|
||||
cd alpine-cli
|
||||
chpst -e ~/.envdir sudo --preserve-env just registry_pass_var=GH_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 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
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM docker.io/library/alpine:latest
|
||||
FROM docker.io/library/alpine:3
|
||||
|
||||
LABEL org.opencontainers.image.title=jswank/alpine-cli \
|
||||
org.opencontainers.image.description="A minimal image for running Linux CLI utilities" \
|
||||
@ -6,6 +6,8 @@ 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 \
|
||||
|
||||
@ -12,7 +12,7 @@ images.
|
||||
|
||||
## Quickstart
|
||||
```console
|
||||
$ docker run -ti --rm ghcr.io/jswank/alpine-cli:3
|
||||
$ docker run -ti --rm ghcr.io/jswank/alpine-cli
|
||||
~ $ ^D
|
||||
exit
|
||||
|
||||
@ -76,7 +76,7 @@ exit
|
||||
|
||||
Bonus - the same script could be used to start other containers:
|
||||
```console
|
||||
$ bin/cli image=alpine:latest
|
||||
$ bin/cli image=alpine:3
|
||||
/ # ^D
|
||||
```
|
||||
|
||||
|
||||
31
Taskfile.yml
Normal file
31
Taskfile.yml
Normal file
@ -0,0 +1,31 @@
|
||||
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
|
||||
|
||||
image := "ghcr.io/jswank/alpine-cli:edge"
|
||||
image := "ghcr.io/jswank/alpine-cli:3"
|
||||
n := "alpine-cli"
|
||||
|
||||
# Invoke the 'run' recipe
|
||||
|
||||
5
justfile
5
justfile
@ -11,12 +11,11 @@ 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
|
||||
podman build -t {{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 push {{registry}}/{{image}}:{{alt_tag}}
|
||||
@ podman logout {{registry}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user