File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ FROM python:3.8-slim
33
44LABEL maintainer="Viking Analytics AB"
55
6- ENV BUILDER_VERSION 1.0
6+ ENV BUILDER_VERSION=1.0 \
7+ APP_ROOT="/app_root" \
8+ STI_SCRIPTS_PATH="/.s2i/bin"
79
810# Set labels used in OpenShift to describe the builder image
911LABEL io.k8s.description="Platform for building Daeploy images with reduced size" \
Original file line number Diff line number Diff line change @@ -13,13 +13,14 @@ if [[ "$1" == "-h" ]]; then
1313fi
1414
1515echo " ---> Installing application source ..."
16- mv /tmp/src/* " $HOME "
16+ mkdir -p " $APP_ROOT /src"
17+ mv /tmp/src/* " $APP_ROOT /src"
1718
1819# Install dependencies
1920echo " ---> Upgrading pip and setuptools"
2021pip install -U pip setuptools
2122
22- cd $HOME
23+ cd " $APP_ROOT /src "
2324if [[ -f requirements.txt ]]; then
2425 echo " ---> Installing dependencies..."
2526 python -m pip install -r requirements.txt
Original file line number Diff line number Diff line change 77# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md
88#
99
10- cd $HOME
10+ cd " $APP_ROOT /src "
1111
1212if [ -z " $APP_SCRIPT " ] && [ -z " $APP_FILE " ] && [ -z " $APP_MODULE " ]; then
1313 # Set default values for APP_SCRIPT and APP_FILE only when all three APP_
@@ -24,8 +24,9 @@ if [ ! -z "$APP_SCRIPT" ]; then
2424 if [[ -f " $APP_SCRIPT " ]]; then
2525 echo " ---> Running application from script ($APP_SCRIPT ) ..."
2626 if [[ " $APP_SCRIPT " != /* ]]; then
27- APP_SCRIPT=" $HOME /$APP_SCRIPT "
27+ APP_SCRIPT=" $APP_ROOT /src /$APP_SCRIPT "
2828 fi
29+ chmod +x " $APP_SCRIPT "
2930 " $APP_SCRIPT "
3031 elif [[ -z " $APP_SCRIPT_DEFAULT " ]]; then
3132 echo " ERROR: file '$APP_SCRIPT ' not found." && exit 1
3536if [ ! -z " $APP_FILE " ]; then
3637 if [[ -f " $APP_FILE " ]]; then
3738 echo " ---> Running application from Python script ($APP_FILE ) ..."
38- python " $HOME / $ APP_FILE"
39+ python " $APP_FILE "
3940 elif [[ -z " $APP_FILE_DEFAULT " ]]; then
4041 echo " ERROR: file '$APP_FILE ' not found." && exit 1
4142 fi
You can’t perform that action at this time.
0 commit comments