Skip to content

Commit

Permalink
refactor(Dockerfile): add a bunch of OCI labels (#87)
Browse files Browse the repository at this point in the history
* refactor(Dockerfile): add a bunch of OCI labels

* fix

---------

Co-authored-by: very-doge-wow <very-doge-wow@github.com>
  • Loading branch information
very-doge-wow and very-doge-wow authored Mar 24, 2024
1 parent f3874de commit 5425e5a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ jobs:

- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }}-stella-test .
docker build \
--build-arg="COMMIT_SHA=${{ github.sha }}"\
--build-arg="IMAGE_VERSION=${{ github.sha }}-stella-test" \
-t ghcr.io/${{ github.repository }}:${{ github.sha }}-stella-test .
5 changes: 4 additions & 1 deletion .github/workflows/docker-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ jobs:

- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:latest .
docker build \
--build-arg="COMMIT_SHA=${{ github.sha }}"\
--build-arg="IMAGE_VERSION=latest" \
-t ghcr.io/${{ github.repository }}:latest .
docker push ghcr.io/${{ github.repository }}:latest
5 changes: 4 additions & 1 deletion .github/workflows/docker-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:

- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.ref_name }} .
docker build \
--build-arg="COMMIT_SHA=${{ github.sha }}"\
--build-arg="IMAGE_VERSION=${{ github.ref_name }}" \
-t ghcr.io/${{ github.repository }}:${{ github.ref_name }} .
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}
docker tag ghcr.io/${{ github.repository }}:${{ github.ref_name }} ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:latest
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM python:3.12-alpine3.19

ARG IMAGE_VERSION=latest
ARG COMMIT_SHA=unknown

USER root

WORKDIR app
Expand All @@ -19,4 +22,12 @@ USER 1000

ENTRYPOINT ["stella"]

LABEL "org.opencontainers.image.source"="https://github.com/very-doge-wow/stella"
LABEL org.opencontainers.image.source="https://github.com/very-doge-wow/stella"
LABEL org.opencontainers.image.url="https://github.com/very-doge-wow/stella"
LABEL org.opencontainers.image.documentation="https://github.com/very-doge-wow/stella/blob/main/README.md"
LABEL org.opencontainers.image.version=${IMAGE_VERSION}
LABEL org.opencontainers.image.revision=${COMMIT_SHA}
LABEL org.opencontainers.image.vendor="very-doge-wow"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.title="stella"
LABEL org.opencontainers.image.description="stella is a free tool to help automatically generate helm chart documentation."

0 comments on commit 5425e5a

Please sign in to comment.