updated Dockerfile and set build date using an ARG
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2020-03-04 17:09:02 +01:00
parent d793224172
commit 2336352d7b
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 25 additions and 4 deletions

View File

@ -1,7 +1,18 @@
FROM archlinux
ENV container=docker
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://git.dotya.ml/wanderer/docker-archlinux-hugo.git" \
org.label-schema.vcs-ref=$VCS_REF
RUN pacman -Syu --noconfirm --needed wget tar git \
&& pacman -Scc \
&& rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* \
&& wget https://github.com/gohugoio/hugo/releases/download/v0.66.0/hugo_extended_0.66.0_Linux-64bit.tar.gz -O hugo.tgz \
&& tar xfv hugo.tgz \
&& mv -v hugo /usr/local/bin/ && rm -v hugo.tgz README.md LICENSE
&& rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/*
RUN wget https://github.com/gohugoio/hugo/releases/download/v0.66.0/hugo_extended_0.66.0_Linux-64bit.tar.gz -O hugo.tgz \
&& tar xfv hugo.tgz && rm -v hugo.tgz README.md LICENSE \
&& mv -v hugo /usr/local/bin/

10
hooks/build Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# as per https://github.com/rossf7/label-schema-automated-build
# $IMAGE_NAME var is injected into the build so the tag is correct.
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 .