Remove packages file from image when using Source-to-Image before doing a build, rather than after.

This commit is contained in:
Graham Dumpleton
2018-02-19 13:17:54 +11:00
parent 52fba5967f
commit f0cdbd536b

View File

@@ -4,6 +4,16 @@ set -x
set -eo pipefail set -eo pipefail
# Remove any 'environment.yml' or 'requirements.txt' files which may
# have been carried over from the base image so we don't reinstall
# packages which have already been installed. This could occur where
# an S2I build was used to create a new base image with pre-installed
# Python packages, with the new image then subsequently being used as a
# S2I builder base image.
rm -f /home/$NB_USER/work/environment.yml
rm -f /home/$NB_USER/work/requirements.txt
# Copy injected files to correct place in 'work' directory. # Copy injected files to correct place in 'work' directory.
cp -Rf /tmp/src/. /home/$NB_USER/work cp -Rf /tmp/src/. /home/$NB_USER/work
@@ -25,13 +35,6 @@ else
fi fi
fi fi
# Remove any 'environment.yml' or 'requirements.txt' file when done in
# case we are producing an image which will in turn be used as an S2I
# builder image.
rm -f /home/$NB_USER/work/environment.yml
rm -f /home/$NB_USER/work/requirements.txt
# Fix up permissions on home directory and Python installation so that # Fix up permissions on home directory and Python installation so that
# everything is still writable by 'users' group. # everything is still writable by 'users' group.