Skip to content

Commit

Permalink
docker: Associate build-time metadata with the image
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Sep 28, 2016
1 parent c84be0d commit 089eb5c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions test/Docker-ITK-v4.8.0_USE_SYSTEM_LIBRARIES-OFF/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,16 @@ RUN git clone git://itk.org/ITK.git && \
../ITK && \
ninja install && \
rm -rf ITK ITK-build

# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG IMAGE
ARG VCS_REF
ARG VCS_URL
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name=$IMAGE \
org.label-schema.description="An open-source CMake-based project that provides macros and associated tools for the easy building of 3D Slicer command line interface (CLI) modules." \
org.label-schema.url="http://www.slicer.org" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.schema-version="1.0"
8 changes: 7 additions & 1 deletion test/Docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ then
die "Empty Path to Dockerfile "
fi

image=slicer/slicerexecutionmodel
lower_case_tag="`echo $1 | tr "[:upper:]" "[:lower:]" `"
docker build -t slicer/slicerexecutionmodel:$lower_case_tag $2
docker build -t $image:$lower_case_tag \
--build-arg IMAGE=$image \
--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"` \
$2

0 comments on commit 089eb5c

Please sign in to comment.