forked from dyvenia/viadot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (60 loc) · 2.82 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
FROM prefecthq/prefect:0.15.11-python3.8
# Add user
RUN useradd --create-home viadot && \
chown -R viadot /home/viadot && \
usermod -aG sudo viadot && \
find /usr/local/lib -type d -exec chmod 777 {} \; && \
find /usr/local/bin -type d -exec chmod 777 {} \;
RUN groupadd docker && \
usermod -aG docker viadot
# Release File Error
# https://stackoverflow.com/questions/63526272/release-file-is-not-valid-yet-docker
RUN echo "Acquire::Check-Valid-Until \"false\";\nAcquire::Check-Date \"false\";" | cat > /etc/apt/apt.conf.d/10no--check-valid-until
# System packages
RUN apt update -q && yes | apt install -q vim unixodbc-dev build-essential \
curl python3-dev libboost-all-dev libpq-dev graphviz python3-gi sudo git software-properties-common
RUN pip install --upgrade cffi
RUN curl http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1_amd64.deb \
-o multiarch-support_2.27-3ubuntu1_amd64.deb && \
apt install -q ./multiarch-support_2.27-3ubuntu1_amd64.deb
# Fix for old SQL Servers still using TLS < 1.2
RUN chmod +rwx /usr/lib/ssl/openssl.cnf && \
sed -i 's/SECLEVEL=2/SECLEVEL=1/g' /usr/lib/ssl/openssl.cnf
# ODBC -- make sure to pin driver version as it's reflected in odbcinst.ini
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt update -q && \
apt install -q libsqliteodbc && \
ACCEPT_EULA=Y apt install -q -y msodbcsql17=17.8.1.1-1 && \
ACCEPT_EULA=Y apt install -q -y mssql-tools && \
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
COPY docker/odbcinst.ini /etc
# This one's needed for the SAP RFC connector.
# It must be installed here as the SAP package does not define its dependencies,
# so `pip install pyrfc` breaks if all deps are not already present.
RUN pip install cython==0.29.24
# Python env
WORKDIR /code
COPY requirements.txt /code/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
COPY . .
RUN pip install .
## Install Java 11
RUN apt install -y wget apt-transport-https && \
mkdir -p /etc/apt/keyrings && \
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc && \
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list && \
apt update -q && \
apt install -q temurin-11-jdk -y && \
find /usr/bin/java -type d -exec chmod 777 {} \;
### Export env variable
ENV SPARK_HOME /usr/local/lib/python3.8/site-packages/pyspark
RUN export SPARK_HOME
RUN rm -rf /code
# Workdir
ENV USER viadot
ENV HOME="/home/$USER"
WORKDIR ${HOME}
USER ${USER}
EXPOSE 8000