-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
44 lines (33 loc) · 1.56 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This image provides an OpenJDK 8 environment with maven
FROM centos/s2i-base-centos7
EXPOSE 8080
ENV JAVA_TOOL_OPTIONS="" \
PATH=$HOME/.local/bin/:$PATH \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
ADD contrib /opt/app-root
ADD container-scripts /usr/share/container-scripts
# Get prefix path and path to scripts rather than hard-code them in scripts
ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/openjdk-8-maven \
ENABLED_COLLECTIONS=rh-maven33
# When bash is started non-interactively, to run a shell script, for example it
# looks for this variable and source the content of this file. This will enable
# the SCL for all scripts without need to do 'scl enable'.
ENV BASH_ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \
ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \
PROMPT_COMMAND=". ${CONTAINER_SCRIPTS_PATH}/scl_enable"
# In order to drop the root user, we have to make some directories world
# writable as OpenShift default security model is to run the container under
# random UID.
RUN chown -R 1001:0 /opt/app-root && chmod -R og+rwx /opt/app-root
RUN yum install -y centos-release-scl-rh && \
yum-config-manager --enable centos-sclo-rh-testing && \
INSTALL_PKGS="rh-maven33 nss_wrapper git" && \
yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all -y
USER 1001
# Set the default CMD to print the usage of the language image.
CMD $STI_SCRIPTS_PATH/usage