bootstrap/config.py: add ARG in Dockerfile to allow add sha1sum into docker image
authorJoe Guo <joeg@catalyst.net.nz>
Tue, 19 Mar 2019 03:31:47 +0000 (16:31 +1300)
committerStefan Metzmacher <metze@samba.org>
Thu, 18 Apr 2019 12:09:33 +0000 (12:09 +0000)
Add ARG SHA1SUM, then we can pass it to docker build with --build-arg

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
bootstrap/config.py

index a658fdda2238f64b54bb2dbfdf670a55333a2168..d78ee02ec30769e5bb5d7bb637b2bff571ecce19 100644 (file)
@@ -267,6 +267,10 @@ fi
 DOCKERFILE = r"""
 FROM {docker_image}
 
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
 ADD *.sh /tmp/
 # need root permission, do it before USER samba
 RUN /tmp/bootstrap.sh && /tmp/locale.sh