Skip to content

Commit 089eb5c

Browse files
committed
docker: Associate build-time metadata with the image
1 parent c84be0d commit 089eb5c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

test/Docker-ITK-v4.8.0_USE_SYSTEM_LIBRARIES-OFF/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,16 @@ RUN git clone git://itk.org/ITK.git && \
3636
../ITK && \
3737
ninja install && \
3838
rm -rf ITK ITK-build
39+
40+
# Build-time metadata as defined at http://label-schema.org
41+
ARG BUILD_DATE
42+
ARG IMAGE
43+
ARG VCS_REF
44+
ARG VCS_URL
45+
LABEL org.label-schema.build-date=$BUILD_DATE \
46+
org.label-schema.name=$IMAGE \
47+
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." \
48+
org.label-schema.url="http://www.slicer.org" \
49+
org.label-schema.vcs-ref=$VCS_REF \
50+
org.label-schema.vcs-url=$VCS_URL \
51+
org.label-schema.schema-version="1.0"

test/Docker/build.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ then
1515
die "Empty Path to Dockerfile "
1616
fi
1717

18+
image=slicer/slicerexecutionmodel
1819
lower_case_tag="`echo $1 | tr "[:upper:]" "[:lower:]" `"
19-
docker build -t slicer/slicerexecutionmodel:$lower_case_tag $2
20+
docker build -t $image:$lower_case_tag \
21+
--build-arg IMAGE=$image \
22+
--build-arg VCS_REF=`git rev-parse --short HEAD` \
23+
--build-arg VCS_URL=`git config --get remote.origin.url` \
24+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
25+
$2

0 commit comments

Comments
 (0)