taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 8739d715b1afd507b57a6b2f1042ed662f4aa284
parent 569c9374ea9155808d6b3bfe72730770f1382202
Author: MS <ms@taler.net>
Date:   Wed, 16 Nov 2022 23:15:34 +0100

No dummy file to conditionally copy from host.

Diffstat:
Mdocker/demo/build_base.sh | 17++++++-----------
Mdocker/demo/images/base/Dockerfile | 8+++++++-
2 files changed, 13 insertions(+), 12 deletions(-)

diff --git 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 @@ -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}