2024-01-14 14:57:09 -08:00
|
|
|
#!/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
|