diff --git a/Dockerfile b/Dockerfile index bcd4a9f..7045d93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,22 @@ FROM alekzonder/puppeteer:1 LABEL maintainer Nemo +ARG BUILD_DATE +ARG VCS_REF + WORKDIR /app COPY package.json package-lock.json /app/ RUN npm install +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="Prometheus ACT Exporter" \ + org.label-schema.vcs-url="https://git.captnemo.in/nemo/prometheus-act-exporter.git" \ + org.label-schema.url="https://git.captnemo.in/nemo/prometheus-act-exporter" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.schema-version="1.0.0-rc1" + COPY index.js server.js /app/ ENTRYPOINT ["/usr/local/bin/node", "server.js"] diff --git a/hooks/build b/hooks/build new file mode 100644 index 0000000..ad9535d --- /dev/null +++ b/hooks/build @@ -0,0 +1,10 @@ +#!/bin/bash + +# $IMAGE_NAME var is injected into the build so the tag is correct. +# See https://medium.com/microscaling-systems/labelling-automated-builds-on-docker-hub-f3d073fb8e1 for +# more details + +echo "Build hook running" +docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ +-t $IMAGE_NAME . \ No newline at end of file