uci-docker-build/Dockerfile.d/create

18 lines
780 B
Plaintext
Raw Normal View History

#!/bin/bash
echo "------------ creating Dockfile from template in Dockerfile.d -------------"
mkdir -p $BDIR/.src
[[ ! -f $BDIR/.src/Dockerfile ]] && echo "#dummy file" > $BDIR/.src/Dockerfile
[[ -f $APPEND_BUILD_ENV ]] && source "$APPEND_BUILD_ENV" && echo using $APPEND_BUILD_ENV when building Dockerfile && cat $APPEND_BUILD_ENV && echo -e "\n-----"
pushd $(dirname "$(realpath "$BASH_SOURCE")") > /dev/null || return 1
source <(../lib/bash-tpl Dockerfile.tpl ) | grep -v '^# ' > ../Dockerfile
if [[ $VERBOSE ]]; then
echo -e "\n#### Dockerfile to use from template ####\n"
cat $BDIR/Dockerfile
echo -e "\n#### end Dockerfile to use from template ####"
fi
echo "done ------- creating Dockfile from template in Dockerfile.d -------------"
popd > /dev/null || return 2