diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8299ce1f4..616ccab62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,6 +198,13 @@ jobs: name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip path: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip + - name: Copy license file + env: + LICENSE_DIR: ".release/linux/package/usr/share/doc/${{ env.PKG_NAME }}" + run: | + mkdir -p "$LICENSE_DIR" + cp LICENSE "$LICENSE_DIR/LICENSE.txt" + - name: Package uses: hashicorp/actions-packaging-linux@v1 with: diff --git a/Dockerfile b/Dockerfile index bca0ce332..430b5e526 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,22 @@ ARG PRODUCT_REVISION # TARGETARCH and TARGETOS are set automatically when --platform is provided. ARG TARGETOS TARGETARCH -LABEL maintainer="Nomad Team " -LABEL version=${PRODUCT_VERSION} -LABEL revision=${PRODUCT_REVISION} +LABEL maintainer="Nomad Team " \ + version=${PRODUCT_VERSION} \ + revision=${PRODUCT_REVISION} \ + org.opencontainers.image.title="nomad" \ + org.opencontainers.image.description="Nomad is a lightweight and flexible orchestrator for heterogenous workloads" \ + org.opencontainers.image.authors="Nomad Team " \ + org.opencontainers.image.url="https://www.nomadproject.io/" \ + org.opencontainers.image.documentation="https://www.nomadproject.io/docs" \ + org.opencontainers.image.source="https://github.com/hashicorp/nomad" \ + org.opencontainers.image.version=${PRODUCT_VERSION} \ + org.opencontainers.image.revision=${PRODUCT_REVISION} \ + org.opencontainers.image.vendor="HashiCorp" \ + org.opencontainers.image.licenses="BUSL-1.1" + +RUN mkdir -p /usr/share/doc/nomad +COPY LICENSE /usr/share/doc/nomad/LICENSE.txt COPY dist/$TARGETOS/$TARGETARCH/nomad /bin/ COPY ./scripts/docker-entrypoint.sh / diff --git a/GNUmakefile b/GNUmakefile index 205215786..8de353885 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -114,7 +114,10 @@ pkg/windows_%/nomad: GO_TAGS += timetzdata # Define package targets for each of the build targets we actually have on this system define makePackageTarget -pkg/$(1).zip: pkg/$(1)/nomad +pkg/$(1)/LICENSE.txt: + @cp LICENSE pkg/$(1)/LICENSE.txt + +pkg/$(1).zip: pkg/$(1)/nomad pkg/$(1)/LICENSE.txt @echo "==> Packaging for $(1)..." @zip -j pkg/$(1).zip pkg/$(1)/*