-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
103 lines (85 loc) · 3.06 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
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
ARG IMAGE_SOURCE
FROM ${IMAGE_SOURCE}ubuntu:22.04 AS systemdependencies
# FROM ubuntu:kinetic AS systemdependencies
LABEL maintainer: "robin.buratti@magellium.fr"
ENV LANG C.UTF-8
ENV LC_ C.UTF-8
RUN ulimit -s unlimited
# Proxy from secret volumes
RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \
apt-get update -y && \
apt-get install -y ca-certificates
# Ajout des certificats
COPY cert[s]/* /usr/local/share/ca-certificates/
RUN update-ca-certificates
# Install libraries
RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi \
&& apt-get -qq update \
&& DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends \
software-properties-common \
gcc \
python3.10 \
python3-dev \
build-essential \
gdal-bin \
libgdal-dev \
&& rm -rf /var/lib/apt/lists/*
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
ENV C_INCLUDE_PATH=/usr/include/gdal
# GRS INSTALL
WORKDIR /home/
COPY ecmwf ./grs2/ecmwf
COPY exe ./grs2/exe
COPY grs ./grs2/grs
COPY grsdata ./grs2/grsdata
COPY setup.py ./grs2/
WORKDIR /home/grs2
#########################
FROM ${IMAGE_SOURCE}ubuntu:22.04
LABEL maintainer: "robin.buratti@magellium.fr"
ENV LANG C.UTF-8
ENV LC_ C.UTF-8
RUN ulimit -s unlimited
RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi \
&& apt-get -qq update \
&& DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends \
python-is-python3 \
python3.10 \
python3-dev \
python3-pip \
python3-affine \
python3-gdal \
python3-lxml \
python3-xmltodict \
gdal-bin \
&& rm -rf /var/lib/apt/lists/*
# get GRS from systemdependencies
COPY --from=systemdependencies /home/grs2 /home/grs2
WORKDIR /home/grs2
# Add additionnal dependencies + GRS
RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi \
&& pip3 install \
--trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org \
--no-cache-dir \
# requirements
cdsapi \
dask \
dask[array] \
docopt \
geopandas \
matplotlib \
netCDF4 \
numpy \
pandas \
pyproj \
python-dateutil \
scipy \
"xarray==2023.8.0" \
# other dependencies
"eoreader==0.20.3" \
numba \
&& pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org .
RUN mkdir -p /datalake/watcal/GRS \
&& cp -r grsdata /datalake/watcal/GRS/
WORKDIR /home/
#ENTRYPOINT ["tail", "-f", "/dev/null"]