diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index 68d2ee5..acbafd4 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -1,4 +1,6 @@ -FROM --platform=$BUILDPLATFORM alpine:3.21.2 as alpine +ARG BASE_IMAGE=alpine:3.21.2 + +FROM --platform=$BUILDPLATFORM $BASE_IMAGE as alpine RUN apk add --no-cache \ ca-certificates \ @@ -6,6 +8,13 @@ RUN apk add --no-cache \ FROM scratch LABEL "com.centurylinklabs.watchtower"="true" +LABEL "org.opencontainers.image.url"="https://nicholas-fedor.github.io/watchtower/" \ + "org.opencontainers.image.documentation"="https://nicholas-fedor.github.io/watchtower/" \ + "org.opencontainers.image.source"="https://github.com/nicholas-fedor/watchtower" \ + "org.opencontainers.image.licenses"="Apache-2.0" \ + "org.opencontainers.image.title"="Watchtower" \ + "org.opencontainers.image.description"="A process for automating Docker container base image updates." \ + "org.opencontainers.image.base.name"="$BASE_IMAGE" COPY --from=alpine \ /etc/ssl/certs/ca-certificates.crt \ diff --git a/dockerfiles/Dockerfile.dev-self-contained b/dockerfiles/Dockerfile.dev-self-contained index 910b0ff..46c6d22 100644 --- a/dockerfiles/Dockerfile.dev-self-contained +++ b/dockerfiles/Dockerfile.dev-self-contained @@ -36,6 +36,13 @@ RUN \ FROM scratch LABEL "com.centurylinklabs.watchtower"="true" +LABEL "org.opencontainers.image.url"="https://nicholas-fedor.github.io/watchtower/" \ + "org.opencontainers.image.documentation"="https://nicholas-fedor.github.io/watchtower/" \ + "org.opencontainers.image.source"="https://github.com/nicholas-fedor/watchtower" \ + "org.opencontainers.image.licenses"="Apache-2.0" \ + "org.opencontainers.image.title"="Watchtower" \ + "org.opencontainers.image.description"="A process for automating Docker container base image updates." \ + "org.opencontainers.image.base.name"="alpine" # copy files from other container COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt diff --git a/goreleaser.yml b/goreleaser.yml index 89f4402..55bc756 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -10,11 +10,11 @@ build: - arm - arm64 ldflags: - - -s -w -X github.com/nicholas-fedor/watchtower/internal/meta.Version={{.Version}} + - -s -w -X github.com/nicholas-fedor/watchtower/internal/meta.Version={{ .Version }} archives: - - name_template: "{{.ProjectName}}_{{.Os}}_{{.Arch}}" + name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" format: tar.gz replacements: arm: armhf @@ -31,7 +31,11 @@ archives: dockers: - use_buildx: true - build_flag_templates: [ "--platform=linux/amd64" ] + build_flag_templates: + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" goos: linux goarch: amd64 goarm: '' @@ -43,7 +47,11 @@ dockers: - ghcr.io/nicholas-fedor/watchtower:amd64-latest - use_buildx: true - build_flag_templates: [ "--platform=linux/i386" ] + build_flag_templates: + - "--platform=linux/i386" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" goos: linux goarch: "386" goarm: '' @@ -55,7 +63,11 @@ dockers: - ghcr.io/nicholas-fedor/watchtower:i386-latest - use_buildx: true - build_flag_templates: [ "--platform=linux/arm/v6" ] + build_flag_templates: + - "--platform=linux/arm/v6" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" goos: linux goarch: arm goarm: 6 @@ -67,7 +79,11 @@ dockers: - ghcr.io/nicholas-fedor/watchtower:armhf-latest - use_buildx: true - build_flag_templates: [ "--platform=linux/arm64/v8" ] + build_flag_templates: + - "--platform=linux/arm64/v8" + - "--label=org.opencontainers.image.created={{ .Date }}" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" goos: linux goarch: arm64 goarm: ''