-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (55 loc) · 2.36 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Specify an ML Runtime base image
FROM docker.repository.cloudera.com/cloudera/cdsw/ml-runtime-jupyterlab-python3.9-cuda:2022.04.1-b6
# Install and upgrade system packages in the new image
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
file \
gdal-bin \
gnupg \
libgdal-dev \
libgl1 \
libproj-dev \
libpython3.9 \
libspatialindex-dev \
proj-bin \
python3-dev \
python3-venv \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Orfeo Toolbox
ARG otb_version=8.0.1
ENV OTB_PACKAGE_NAME=OTB-${otb_version}-Linux64
RUN wget -q https://www.orfeo-toolbox.org/packages/$OTB_PACKAGE_NAME.run \
&& chmod +x ./$OTB_PACKAGE_NAME.run \
&& mv ./$OTB_PACKAGE_NAME.run /opt/ \
&& cd /opt/ \
&& /opt/$OTB_PACKAGE_NAME.run \
&& rm -f /opt/$OTB_PACKAGE_NAME.run \
&& ln -s /opt/$OTB_PACKAGE_NAME /opt/OTB
# Install gcloud SDK
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \
&& apt-get update -y && apt-get install google-cloud-cli -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
ARG short_version
ARG maintenance_version
# Override Runtime label and environment variables metadata
ENV ML_RUNTIME_EDITION="AI Climate NVIDIA GPU" \
ML_RUNTIME_SHORT_VERSION=$short_version \
ML_RUNTIME_MAINTENANCE_VERSION=$maintenance_version \
ML_RUNTIME_DESCRIPTION="This runtime includes support for NVIDIA CUDA, GDAL, OGR and other packages used by the AI Climate solution"
ENV ML_RUNTIME_FULL_VERSION="${ML_RUNTIME_SHORT_VERSION}.${ML_RUNTIME_MAINTENANCE_VERSION}"
RUN echo "$ML_RUNTIME_EDITION $ML_RUNTIME_FULL_VERSION"
LABEL com.cloudera.ml.runtime.edition=$ML_RUNTIME_EDITION \
com.cloudera.ml.runtime.full-version=$ML_RUNTIME_FULL_VERSION \
com.cloudera.ml.runtime.short-version=$ML_RUNTIME_SHORT_VERSION \
com.cloudera.ml.runtime.maintenance-version=$ML_RUNTIME_MAINTENANCE_VERSION \
com.cloudera.ml.runtime.description=$ML_RUNTIME_DESCRIPTION