summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorMS <ms@taler.net>2022-11-16 23:15:34 +0100
committerMS <ms@taler.net>2022-11-16 23:15:34 +0100
commit8739d715b1afd507b57a6b2f1042ed662f4aa284 (patch)
tree5c340b31f8569459984d94f5c46b6f6949b27f56 /docker
parent569c9374ea9155808d6b3bfe72730770f1382202 (diff)
downloaddeployment-8739d715b1afd507b57a6b2f1042ed662f4aa284.tar.gz
deployment-8739d715b1afd507b57a6b2f1042ed662f4aa284.tar.bz2
deployment-8739d715b1afd507b57a6b2f1042ed662f4aa284.zip
No dummy file to conditionally copy from host.
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/demo/build_base.sh17
-rw-r--r--docker/demo/images/base/Dockerfile8
2 files changed, 13 insertions, 12 deletions
diff --git a/docker/demo/build_base.sh b/docker/demo/build_base.sh
index 57b639d..578ee9d 100755
--- a/docker/demo/build_base.sh
+++ b/docker/demo/build_base.sh
@@ -25,6 +25,11 @@ if ! test -a $DOCKER_FILE; then
exit 1
fi
+# Allows extra features to conditionally copy files
+# from the host during the build. That solves the
+# case where the tag file is not given.
+export DOCKER_BUILDKIT=1
+
if test -n "$2"; then
! test -a "$2" && (echo "Tag file: $2 not found." && exit 1)
TAGS_FILE_DIR=$(dirname $2)
@@ -38,16 +43,6 @@ if test -n "$2"; then
exit 0
fi
-# Tags file not given, need a dummy one to
-# make COPY happy.
-echo Creating the dummy 'taler_notags' file.
-touch taler_notags
docker build --no-cache \
-t taler_local/taler_base \
- -f $DOCKER_FILE . || (
- echo Removing the dummy 'taler_notags' file.
- rm -f taler_notags
- exit 1
- )
-echo Removing the dummy 'taler_notags' file.
-rm -f taler_notags
+ -f $DOCKER_FILE .
diff --git a/docker/demo/images/base/Dockerfile b/docker/demo/images/base/Dockerfile
index 840ca66..222f9ba 100644
--- a/docker/demo/images/base/Dockerfile
+++ b/docker/demo/images/base/Dockerfile
@@ -11,7 +11,13 @@ RUN apt-get install -y autoconf autopoint libtool texinfo \
RUN pip3 install requests click poetry uwsgi htmlark
ARG tags_file
-COPY ${tags_file:-taler_notags} /tags.sh
+# The following command works around COPY not being conditional.
+# Mounts the current directory - where the tags file might be -
+# to /context in the container. Note: build_base.sh 'cd' to
+# the tags file's directory before building, and sets $tags_file
+# to the tags file's basename.
+RUN --mount=target=/context if test -n "$tags_file"; then cp \
+/context/${tags_file} /tags.sh; else touch /tags.sh; fi
RUN . /tags.sh && git clone git://git.gnunet.org/libmicrohttpd \
--branch ${TAG_LIBMHD:-master}