updated Dockerfile and set build date using an ARG
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d793224172
commit
2336352d7b
19
Dockerfile
19
Dockerfile
|
@ -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/
|
||||
|
|
|
@ -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 .
|
Loading…
Reference in New Issue