From dee97790978fee968782896e655bb18bb81ce603 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Sep 2017 01:19:16 +0200 Subject: [PATCH] testing labels --- Dockerfile | 9 +++++++++ hooks/build | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 hooks/build diff --git a/Dockerfile b/Dockerfile index 0b74dfd..464a1bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,15 @@ FROM alpine:latest MAINTAINER Ryan Kes ADD VERSION . +ARG BUILD_DATE +ARG VCS_REF +ARG VCS_URL + +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.vcs-url=$VCS_URL \ + org.label-schema.vcs-ref=$VCS_REF \ +org.label-schema.schema-version="1.0.0-rc1" + ENV HUGO_VERSION 0.26 ENV HUGO_BINARY hugo_${HUGO_VERSION}_linux-64bit diff --git a/hooks/build b/hooks/build new file mode 100644 index 0000000..e6362c5 --- /dev/null +++ b/hooks/build @@ -0,0 +1,8 @@ +#!/bin/bash + +# $IMAGE_NAME var is injected into the build so the tag is correct. + +docker build --build-arg VCS_REF=`git rev-parse — short HEAD` \ + --build-arg VCS_URL=`git config --get remote.origin.url` \ + --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` \ + -t $IMAGE_NAME .