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 |
12
.build.yml
12
.build.yml
@ -1,12 +1,12 @@
|
|||||||
image: alpine/edge
|
image: alpine/latest
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
- 0ee986ff-5686-43cd-ac3a-1fe5b2e5dd8f
|
- 0ee986ff-5686-43cd-ac3a-1fe5b2e5dd8f
|
||||||
- f523ee29-5ef8-490f-8903-43ad7c49060b
|
- f523ee29-5ef8-490f-8903-43ad7c49060b
|
||||||
- 130adee5-3a8f-4035-8cad-e3d044be2961
|
- 130adee5-3a8f-4035-8cad-e3d044be2961
|
||||||
|
|
||||||
sources:
|
sources:
|
||||||
- https://git.sr.ht/~jswank/alpine-cli
|
- https://git.sr.ht/~jswank/alpine-cli#3
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- podman
|
- podman
|
||||||
@ -24,6 +24,7 @@ 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
|
||||||
@ -33,5 +34,6 @@ 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 just registry=docker.io registry_pass_var=DH_PAT publish
|
# chpst -e ~/.envdir sudo --preserve-env go-task 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
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
FROM docker.io/library/alpine:latest
|
FROM docker.io/library/alpine:3
|
||||||
|
|
||||||
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,6 +6,8 @@ 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:3
|
$ docker run -ti --rm ghcr.io/jswank/alpine-cli
|
||||||
~ $ ^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:latest
|
$ bin/cli image=alpine:3
|
||||||
/ # ^D
|
/ # ^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
|
#!/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"
|
n := "alpine-cli"
|
||||||
|
|
||||||
# Invoke the 'run' recipe
|
# Invoke the 'run' recipe
|
||||||
|
|||||||
5
justfile
5
justfile
@ -11,12 +11,11 @@ registry_pass_var := "REGISTRY_PASSWORD"
|
|||||||
|
|
||||||
# build a new image
|
# build a new image
|
||||||
build flags="":
|
build flags="":
|
||||||
podman manifest create {{image}}:{{tag}}
|
podman build -t {{image}}:{{tag}} {{flags}} -f Dockerfile ctx
|
||||||
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 manifest push {{registry}}/{{image}}:{{alt_tag}}
|
@ podman push {{registry}}/{{image}}:{{alt_tag}}
|
||||||
@ podman logout {{registry}}
|
@ podman logout {{registry}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user