Update Dockerfile to include labels
This commit is contained in:
parent
8f747db4fb
commit
0d3c6a66b0
10
Dockerfile
10
Dockerfile
|
@ -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"]
|
||||
|
|
|
@ -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…
Reference in New Issue