Skip to content

Commit

Permalink
Simplify docker image generation
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Aug 13, 2023
1 parent ba7ef4d commit c7c4519
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,10 @@ jobs:
- uses: docker/metadata-action@v4
id: meta
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=edge
labels: |
org.opencontainers.image.title=Mg
org.opencontainers.image.description=Micro Emacs text editor from OpenBSD
org.opencontainers.image.url=https://github.com/troglobit/mg
org.opencontainers.image.documentation=https://man.troglobit.com/man1/mg.1.html
org.opencontainers.image.source=https://github.com/troglobit/mg/tree/${{ github.sha }}/
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -57,8 +41,6 @@ jobs:
- uses: docker/build-push-action@v4
id: build
with:
build-args: |
DOCKER_METADATA_OUTPUT_JSON
context: .
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.platform }}
Expand All @@ -69,10 +51,10 @@ jobs:
push-by-digest=true,
push=true,
annotation-manifest-descriptor.org.opencontainers.image.title=Mg,
annotation-manifest-descriptor.org.opencontainers.image.description=Micro Emacs text editor for ${{ matrix.platform }},
annotation-manifest-descriptor.org.opencontainers.image.description=Micro Emacs text editor,
annotation-manifest-descriptor.org.opencontainers.image.url=https://github.com/troglobit/mg,
annotation-manifest-descriptor.org.opencontainers.image.licenses=Unlicense,
annotation-manifest-descriptor.org.opencontainers.image.revision=${GITHUB_SHA}
annotation-manifest-descriptor.org.opencontainers.image.revision=${{ github.sha }}
- name: Export digest
run: |
mkdir -p /tmp/digests
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ RUN ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var CFLAGS=-sta
RUN make install-strip

FROM scratch
LABEL org.opencontainers.image.title "Mg"
LABEL org.opencontainers.image.description "Micro Emacs text editor from OpenBSD"
LABEL org.opencontainers.image.documentation "https://man.troglobit.com/man1/mg.1.html"
LABEL org.opencontainers.image.url "https://github.com/troglobit/mg"
LABEL org.opencontainers.image.licenses "Unlicense"

COPY --from=0 /usr/bin/mg /usr/bin/mg
COPY --from=0 /usr/share/doc/mg /usr/share/doc/mg
Expand Down

0 comments on commit c7c4519

Please sign in to comment.