diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 64f261d..1d9cc10 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -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 . diff --git a/.github/workflows/docker-main.yml b/.github/workflows/docker-main.yml index f62ca7b..d25afce 100644 --- a/.github/workflows/docker-main.yml +++ b/.github/workflows/docker-main.yml @@ -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 diff --git a/.github/workflows/docker-tags.yml b/.github/workflows/docker-tags.yml index ef59af5..38e4afa 100644 --- a/.github/workflows/docker-tags.yml +++ b/.github/workflows/docker-tags.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 04f3377..2c19003 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM python:3.12-alpine3.19 +ARG IMAGE_VERSION=latest +ARG COMMIT_SHA=unknown + USER root WORKDIR app @@ -19,4 +22,12 @@ USER 1000 ENTRYPOINT ["stella"] -LABEL "org.opencontainers.image.source"="https://github.com/very-doge-wow/stella" \ No newline at end of file +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."