1- # Used OL8 because miniconda required a higher version of glibc that was unavoidable
2- FROM ocr-docker-remote.artifactory.oci.oraclecorp.com/os/oraclelinux:8-slim-fips
1+ # Copyright (c) 2021, 2023 Oracle and/or its affiliates.
2+ # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
3+
4+ FROM ghcr.io/oracle/oraclelinux:7-slim
35
46# Configure environment
57ENV DATASCIENCE_USER datascience
@@ -9,139 +11,76 @@ ENV DATASCIENCE_INSTALL_DIR /etc/datascience
911ENV LOGS_DIRECTORY /logs
1012
1113ARG release=19
12- ARG update=10
13- ARG target=cpu
14-
15- # Move this arg around the file as needed when you want to use cache for local builds/testing to speed up the process
16- # This will allow you to set success points where you know previous code in the dockerfile is working
17- # ARG RAND
18-
19- COPY common /etc/datascience
20- COPY etc/yum.repos.d /etc/yum.repos.d
21-
22- # source: https://confluence.oraclecorp.com/confluence/pages/viewpage.action?spaceKey=ESEDoc&title=Artifactory+FAQ
23- ADD Symantec_Private_SSL_SHA256_CA.cer /etc/pki/ca-trust/source/anchors
24- ADD Symantec_Private_SSL_SHA256_Root.cer /etc/pki/ca-trust/source/anchors
25-
26- RUN update-ca-trust
27-
28- RUN microdnf install yum yum-utils && yum clean all && rm -rf /var/cache/yum
14+ ARG update=13
2915
3016RUN \
31- yum install -y \
32- oracle-release-el8 \
33- oraclelinux-developer-release-el8 \
34- oracle-epel-release-el8 \
35- https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
36- yum-config-manager --enable ol8_addons --enable ol8_oracle_instantclient > /dev/null && yum -y update && \
37- yum clean all && \
38- rm -rf /var/cache/yum/*
39-
40- RUN \
41- yum install -y \
42- --setopt=skip_missing_names_on_install=False \
17+ yum -y -q install oracle-release-el7 && \
18+ yum-config-manager --add-repo http://yum.oracle.com/repo/OracleLinux/OL7/developer_EPEL/x86_64 && \
19+ yum-config-manager --enable ol7_optional_latest --enable ol7_addons --enable ol7_software_collections --enable ol7_oracle_instantclient > /dev/null && \
20+ yum groupinstall -y -q 'Development Tools' && \
21+ yum update -y && \
22+ yum install -y --setopt=skip_missing_names_on_install=False \
4323 bzip2 \
24+ curl \
4425 git \
45- httpd \
26+ gcc-gfortran \
4627 libcurl-devel \
4728 libxml2-devel \
48- java-11-openjdk-headless \
4929 oracle-instantclient${release}.${update}-basic \
5030 oracle-instantclient${release}.${update}-sqlplus \
5131 openssl \
5232 openssl-devel \
5333 patch \
54- snappy \
55- gcc-c++ \
5634 sudo \
5735 unzip \
58- vi \
5936 zip \
37+ gcc-c++ \
6038 wget \
61- jq \
6239 gcc \
63- htop \
64- git-lfs \
65- pcsc-lite-libs \
66- perl-Env \
67- perl-CPAN \
68- perl-devel \
69- curl-devel \
70- expat-devel \
71- asciidoc \
72- xmlto \
73- supervisor && \
74- yum clean all && \
75- rm -rf /var/cache/yum/*
76-
77- RUN \
78- yum groupinstall -y -q "development tools" \
7940 && yum clean all \
8041 && rm -rf /var/cache/yum/*
8142
8243# setup user
8344RUN \
84- mkdir -p /home/$DATASCIENCE_USER && \
85- useradd -m -s /bin/bash -N -u $DATASCIENCE_UID $DATASCIENCE_USER && \
86- chown $DATASCIENCE_USER /home/$DATASCIENCE_USER && \
87- chown -R $DATASCIENCE_USER:users /usr/local/ && \
88- touch /etc/sudoers.d/$DATASCIENCE_USER && echo "$DATASCIENCE_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/$DATASCIENCE_USER && \
89- mkdir -p $DATASCIENCE_INSTALL_DIR && chown $DATASCIENCE_USER $DATASCIENCE_INSTALL_DIR
90-
91- # COPY build-tool-entrypoint.sh /etc/datascience/build-tool-entrypoint.sh
92- # COPY install-capture-entrypoint.sh /etc/datascience/install-capture-entrypoint.sh
93-
45+ mkdir -p /home/$DATASCIENCE_USER && \
46+ useradd -m -s /bin/bash -N -u $DATASCIENCE_UID $DATASCIENCE_USER && \
47+ chown -R $DATASCIENCE_USER /home/$DATASCIENCE_USER && \
48+ chown -R $DATASCIENCE_USER:users /usr/local/ && \
49+ touch /etc/sudoers.d/$DATASCIENCE_USER && echo "$DATASCIENCE_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/$DATASCIENCE_USER && \
50+ mkdir -p $DATASCIENCE_INSTALL_DIR && chown $DATASCIENCE_USER $DATASCIENCE_INSTALL_DIR && \
51+ mkdir -p $LOGS_DIRECTORY && chown -R $DATASCIENCE_USER:users $LOGS_DIRECTORY && \
52+ mkdir -p $LOGS_DIRECTORY/harness && chown -R $DATASCIENCE_USER:users $LOGS_DIRECTORY/harness
53+
54+ RUN mkdir -p /etc/datascience/build
55+ RUN mkdir -p $DATASCIENCE_INSTALL_DIR/{pre-build-ds,post-build-ds,pre-run-ds,pre-run-user}
56+
57+ #conda
9458# set a default language for localization. necessary for oci cli
9559ARG LANG=en_US.utf8
9660ENV LANG=$LANG
9761ENV SHELL=/bin/bash
9862
99- ############### SETUP ROOT (BASE) ENVIRONMENT WITH CONDA ######################
100- ARG PYTHON_MAJOR='3'
101- ARG PYTHON_MINOR='8'
102- ARG PYTHON_PATCH=''
103- ARG MINICONDA_VER=py${PYTHON_MAJOR}${PYTHON_MINOR}_23.5.2-0
104- ARG MAMBAFORGE_VER=23.3.1-1
105-
10663# set /opt folder permissions for $DATASCIENCE_USER. Conda is going to live in this folder.
107- RUN chown $DATASCIENCE_USER /opt
64+ RUN chown -R $DATASCIENCE_USER /opt
10865
10966USER $DATASCIENCE_USER
11067WORKDIR /home/datascience
68+ RUN wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /home/datascience/miniconda.sh \
69+ && /bin/bash /home/datascience/miniconda.sh -f -b -p /opt/conda \
70+ && rm /home/datascience/miniconda.sh \
71+ && /opt/conda/bin/conda clean -yaf
11172
112- # Note in order to run sudo commands as a non root user, you must specify --credential yes if using qemu static to build the image
113- RUN wget -nv https://artifactory.oci.oraclecorp.com/odsc-dev-generic-local/datascience/Miniconda3-${MINICONDA_VER}-$(uname)-$(uname -m).sh \
114- -O /home/datascience/Miniconda3.sh \
115- && /bin/bash /home/datascience/Miniconda3.sh -f -b -p /opt/conda \
116- && rm /home/datascience/Miniconda3.sh \
117- && wget -nv https://artifactory.oci.oraclecorp.com/odsc-dev-generic-local/datascience/Mambaforge-${MAMBAFORGE_VER}-$(uname)-$(uname -m).sh \
118- -O /home/datascience/Mambaforge3.sh \
119- && /bin/bash /home/datascience/Mambaforge3.sh -f -b -p /opt/conda \
120- && rm /home/datascience/Mambaforge3.sh \
121- && ls /opt/**/*
122-
123- # Adding conda to the path
124- ENV PATH="/opt/conda/bin:${PATH}"
125-
126- # Set activate conda by default
73+ WORKDIR /
12774USER root
12875RUN printf "#!/bin/bash\nsource /opt/conda/bin/activate\n" > /etc/profile.d/enableconda.sh \
12976 && chmod +x /etc/profile.d/enableconda.sh
13077
13178USER $DATASCIENCE_USER
79+ ENV PATH="/opt/conda/bin:${PATH}"
13280WORKDIR /home/datascience
13381
134- COPY base-env-arm.yaml /opt/base-env.yaml
135- COPY jupyter-arm.yaml /opt/jupyter.yaml
136-
137- # Needs to be set to prevent a hang with mamba installations if this dockerfile
138- # is being built by running qemu-user-static to emulate an ARM machine
139- # <https://github.com/mamba-org/mamba/issues/1611>
140- ENV G_SLICE=always-malloc
141-
142- # Replaced conda with mamba. Conda wasn't able to resolve conflicts
143- RUN mamba env update -n root -f /opt/jupyter.yaml && mamba clean -yaf && rm -rf /home/datascience/.cache/pip
144-
82+ COPY docker/base-env.yaml /opt/base-env.yaml
83+ RUN conda env update -q -n root -f /opt/base-env.yaml && conda clean -yaf && rm -rf /home/datascience/.cache/pip
14584
14685USER $DATASCIENCE_USER
14786
@@ -157,3 +96,13 @@ ARG PIP_INDEX_URL
15796
15897############# Setup Conda environment tools ###########################
15998ARG RAND=1
99+
100+ ARG RUN_WORKING_DIR="/home/datascience"
101+ WORKDIR $RUN_WORKING_DIR
102+
103+ # clean tmp folder
104+ RUN rm -rf /tmp/*
105+
106+ RUN mkdir -p /etc/datascience/operators
107+
108+ USER datascience
0 commit comments