@@ -4,25 +4,32 @@ FROM python:3.8-slim
44LABEL maintainer="Viking Analytics AB"
55
66ENV BUILDER_VERSION=1.0 \
7- APP_ROOT="/app_root" \
8- STI_SCRIPTS_PATH="/.s2i/bin"
7+ APP_ROOT="/opt/app-root" \
8+ HOME="/opt/app-root/src" \
9+ STI_SCRIPTS_PATH="/usr/libexec/s2i"
910
1011# Set labels used in OpenShift to describe the builder image
11- LABEL io.k8s.description="Platform for building Daeploy images with reduced size " \
12+ LABEL io.k8s.description="Platform for building lightweight Daeploy images" \
1213 io.k8s.display-name="Daeploy python builder" \
1314 io.openshift.expose-services="8080:http" \
1415 io.openshift.tags="builder,daeploy,python." \
15- io.openshift.s2i.scripts-url="image://.s2i/bin "
16+ io.openshift.s2i.scripts-url="image://${STI_SCRIPTS_PATH} "
1617
1718# Setup virtualenv
1819RUN python -m venv /opt/venv
1920ENV PATH="/opt/venv/bin:$PATH"
2021
2122# Copy the S2I scripts to the image
22- COPY ./s2i/bin/ .s2i/bin
23+ COPY ./s2i/bin/ $STI_SCRIPTS_PATH
2324
24- # TODO: Set the default port for applications built using this image
25+ # Set the default port for applications built using this image
2526EXPOSE 8080
2627
27- # TODO: Set the default CMD for the image
28- CMD [".s2i/bin/usage" ]
28+ # Setup file system
29+ RUN mkdir -p ${APP_ROOT} && \
30+ mkdir -p ${HOME}
31+
32+ WORKDIR $HOME
33+
34+ # Set the default CMD for the image
35+ CMD ["$STI_SCRIPTS_PATH/usage" ]
0 commit comments