File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
Expand file tree Collapse file tree 3 files changed +10
-9
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_
2323if [ ! -z " $APP_SCRIPT " ]; then
2424 if [[ -f " $APP_SCRIPT " ]]; then
2525 echo " ---> Running application from script ($APP_SCRIPT ) ..."
26- if [[ " $APP_SCRIPT " != /* ]]; then
27- APP_SCRIPT=" $HOME /$APP_SCRIPT "
28- fi
29- " $APP_SCRIPT "
26+ chmod +x " ./$APP_SCRIPT "
27+ " ./$APP_SCRIPT "
3028 elif [[ -z " $APP_SCRIPT_DEFAULT " ]]; then
3129 echo " ERROR: file '$APP_SCRIPT ' not found." && exit 1
3230 fi
3533if [ ! -z " $APP_FILE " ]; then
3634 if [[ -f " $APP_FILE " ]]; then
3735 echo " ---> Running application from Python script ($APP_FILE ) ..."
38- python " $HOME / $ APP_FILE"
36+ python " $APP_FILE "
3937 elif [[ -z " $APP_FILE_DEFAULT " ]]; then
4038 echo " ERROR: file '$APP_FILE ' not found." && exit 1
4139 fi
You can’t perform that action at this time.
0 commit comments