Browse Source

Update Dockerfile to include labels

tests 2.0.0-beta
Nemo 2 years ago
parent
commit
0d3c6a66b0
2 changed files with 20 additions and 0 deletions
  1. +10
    -0
      Dockerfile
  2. +10
    -0
      hooks/build

+ 10
- 0
Dockerfile View File

@ -2,12 +2,22 @@ FROM alekzonder/puppeteer:1
LABEL maintainer Nemo <docker@captnemo.in>
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"]


+ 10
- 0
hooks/build View File

@ -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 .

Loading…
Cancel
Save