-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.rhel8
110 lines (88 loc) · 3.42 KB
/
Dockerfile.rhel8
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
FROM submod/s2i-base-ubi8
MAINTAINER Courtney Pacheco <cpacheco@redhat.com>
MAINTAINER Subin Modeel <smodeel@redhat.com>
USER root
ENV BUILDER_VERSION 1.0
LABEL io.k8s.description="S2I builder binaries." \
io.k8s.display-name="BUILD IMAGE" \
io.openshift.expose-services="8080:http" \
io.openshift.tags="builder,python,build-image" \
io.openshift.s2i.scripts-url="image:///usr/libexec/s2i"
##------------------------------------------
## User specific ENVs
##------------------------------------------
ARG BAZEL_VERSION=0.15.0
ARG NB_PYTHON_VER=3.6
ENV BAZEL_VERSION=$BAZEL_VERSION
ENV PYTHON_VER=$NB_PYTHON_VER
ENV LANG=en_US.utf8
##------------------------------------------
## ENVs
##------------------------------------------
ENV TINI_VERSION=v0.16.1
ENV NB_USER=default
ENV NB_UID=1001
ADD playbooks /playbooks
RUN chmod +x /playbooks
##------------------------------------------
## Install repos & User specific rpms
##------------------------------------------
RUN yum -y update \
&& yum -y module install python36 \
&& pip3 install --user ansible \
&& ansible localhost -m setup -e ansible_python_interpreter=/usr/libexec/platform-python
RUN ansible-playbook -i /playbooks/hosts /playbooks/play.yaml --tags "build_environment" --extra-vars="{remove_existing_openblas: 'yes', target: 'PENRYN'}" -v;
##------------------------------------------
## Install tini
##------------------------------------------
RUN wget https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini -P /tmp \
&& wget https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc -P /tmp \
&& cd /tmp \
&& \
TINI_GPGKEY=595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7; \
found=''; \
for server in \
ha.pool.sks-keyservers.net \
hkp://keyserver.ubuntu.com:80 \
hkp://p80.pool.sks-keyservers.net:80 \
pgp.mit.edu \
; do \
echo "Fetching GPG key $TINI_GPGKEY from $server"; \
gpg --batch --keyserver "$server" --recv-keys "$TINI_GPGKEY" && found=yes && break; \
done; \
test -z "$found" && echo >&2 "ERROR: failed to fetch GPG key $TINI_GPGKEY" && exit 1; \
gpg --batch --verify /tmp/tini.asc /tmp/tini \
&& mv /tmp/tini /usr/local/bin/tini \
&& chmod +x /usr/local/bin/tini \
&& mkdir -p /home/$NB_USER/.ssh \
&& chmod -R a+rwx /opt \
&& chown -R 1001:1001 /opt/app-root \
&& chgrp -R root /opt/app-root \
&& chmod -R ug+rwx /opt/app-root \
&& /bin/rm -rf /var/cache/dnf /var/cache/yum
##------------------------------------------
## CookieCutter code below DONOT MODIFY
##------------------------------------------
# No yum commands here
RUN usermod -g root $NB_USER \
&& mkdir -p /workspace \
&& chown $NB_UID:root /workspace \
&& chmod 1777 /workspace \
&& chown -R $NB_UID:root /home/$NB_USER \
&& chmod g+rwX,o+rX -R /home/$NB_USER
COPY ./s2i/bin/ /usr/libexec/s2i
ADD entrypoint /entrypoint
RUN chmod +x /entrypoint
#port for future webapp
EXPOSE 8080
ENV HOME /home/$NB_USER
# This default user is created in the openshift/base-centos7 image
USER 1001
# Make the default PWD somewhere that the user can write. This is
# useful when connecting with 'oc run' and starting a 'spark-shell',
# which will likely try to create files and directories in PWD and
# error out if it cannot.
WORKDIR /workspace
ENTRYPOINT ["/entrypoint"]
# TODO: Set the default CMD for the image
CMD ["/usr/libexec/s2i/usage"]