Skip to content

Commit

Permalink
Add build hooks and build variables
Browse files Browse the repository at this point in the history
  • Loading branch information
wiorca committed Oct 20, 2020
1 parent eb2b02f commit 6afa6fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
# Based on Ubuntu 20.04 LTS
FROM ubuntu:20.04

# Version
# Build arguments
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION=0.0.9

# Labels
LABEL com.wiorca.build-date=$BUILD_DATE \
com.wiorca.vcs-url="https://github.com/wiorca/docker-pia.git" \
com.wiorca.vcs-ref=$VCS_REF \
com.wiorca.schema-version=$VERSION

# The volume for the docker_user home directory, and where configuration files should be stored.
VOLUME [ "/config" ]

Expand Down
8 changes: 8 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -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 BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` \
-t $IMAGE_NAME .

0 comments on commit 6afa6fc

Please sign in to comment.