Modify build-dockerfile to only replace variables as set in in SOLUTIONS / MANIFEST
Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
parent
579a711985
commit
d36c1099a9
@ -11,9 +11,19 @@ fi
|
||||
. SOLUTION
|
||||
. MANIFEST
|
||||
|
||||
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n')
|
||||
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
|
||||
VARS=($(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION))
|
||||
VARS+=($(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST))
|
||||
for var in ${VARS[@]}; do
|
||||
export ${var}
|
||||
done
|
||||
|
||||
# Build a SHELL-FORMAT value to pass to envsubst.
|
||||
# Only those variables matched in SHELL-FORMAT will
|
||||
# be escaped by envsubst.
|
||||
ENV=''
|
||||
for var in ${VARS[@]}; do
|
||||
ENV=${ENV}'$'${var}
|
||||
done
|
||||
|
||||
# Remove the Dockerfile if it exists; should check
|
||||
# if it is clean first, and abort if not.
|
||||
@ -42,7 +52,7 @@ for snippet in templates/??-*.in; do
|
||||
# Template from templates/${snippet}
|
||||
#
|
||||
EOM
|
||||
envsubst < $snippet >> Dockerfile
|
||||
envsubst ${ENV} < $snippet >> Dockerfile
|
||||
done
|
||||
|
||||
cat << EOM >> Dockerfile
|
||||
@ -52,7 +62,7 @@ cat << EOM >> Dockerfile
|
||||
#
|
||||
EOM
|
||||
|
||||
envsubst < Dockerfile.solution >> Dockerfile
|
||||
envsubst ${ENV} < Dockerfile.solution >> Dockerfile
|
||||
|
||||
cat << EOM >> Dockerfile
|
||||
|
||||
@ -61,7 +71,7 @@ cat << EOM >> Dockerfile
|
||||
#
|
||||
EOM
|
||||
|
||||
envsubst < templates/ending.in >> Dockerfile
|
||||
envsubst ${ENV} < templates/ending.in >> Dockerfile
|
||||
|
||||
cat << EOM
|
||||
|
||||
|
@ -1,6 +1,14 @@
|
||||
# Pre-install proxy configuration values
|
||||
#
|
||||
# This uses the linux-ftp.ostc.intel.com as a mirror.
|
||||
RUN { \
|
||||
for suite in ${OS_RELEASE} ${OS_RELEASE}-updates ${OS_RELEASE}-security ${OS_RELEASE}-backports; do \
|
||||
for component in main restricted universe multiverse; do \
|
||||
echo "deb http://linux-ftp.ostc.intel.com/pub/mirrors/${OS_DISTRO} ${suite} ${component}" ; \
|
||||
done \
|
||||
done \
|
||||
} > /etc/apt/sources.list
|
||||
|
||||
RUN { \
|
||||
echo "Acquire::http::proxy \"http://proxy-chain.intel.com:911/\";\n" ; \
|
||||
echo "Acquire::https::proxy \"http://proxy-chain.intel.com:912/\";\n" ; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user