-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
93 lines (71 loc) · 2.32 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
FROM ubuntu:focal
ARG PYTHON_VERSION=3.9
ARG PYLUCENE_VERSION=9.1.0
# Uncomment to install specific version of poetry
ENV LANG=C.UTF-8
# ADD Python PPA Repository
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
software-properties-common gpg-agent && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get remove -y software-properties-common && \
apt-get purge --auto-remove -y && \
apt-get clean
RUN which gpg-agent
# Install Python
RUN apt-get install -y --no-install-recommends \
"python$PYTHON_VERSION-dev" \
python3-setuptools \
python3-pip && \
apt-get remove -y gpg-agent && \
apt-get purge --auto-remove -y && \
apt-get clean
# ======================== START OF ADDITIONAL INSTALLATION ========================
# Install Java
RUN apt-get install -y --no-install-recommends \
build-essential \
ant \
jcc \
curl \
git \
default-jdk
RUN ls /usr/bin/ | grep "python"
RUN ln -s $(which python3.9) /usr/bin/python
RUN which python3.9 && which python && python --version
WORKDIR /usr/lib/jvm/default-java/jre/lib
RUN ln -s ../../lib amd64
# Java 11
RUN java --version && javac --version
# Installing PyLucene
RUN which ant && ant -version
RUN apt-get install -y --no-install-recommends \
libffi-dev \
zlib1g-dev
ENV PREFIX_PYTHON=/usr \
JCC_JDK=/usr/lib/jvm/default-java \
ANT=ant \
JCC='python -m jcc' \
NUM_FILES=10 \
PYTHON=python \
NO_SHARED=1
WORKDIR /usr/src/pylucene
RUN curl https://dlcdn.apache.org/lucene/pylucene/pylucene-9.1.0-src.tar.gz | tar -xz
RUN cd "pylucene-$PYLUCENE_VERSION/jcc" && \
ls -la && \
NO_SHARED=1 JCC_JDK=/usr/lib/jvm/default-java python setup.py build && \
NO_SHARED=1 JCC_JDK=/usr/lib/jvm/default-java python setup.py install && \
cd .. && \
make JCC="python -m jcc" ANT=ant PYTHON=python NUM_FILES=8&& \
make install JCC="python -m jcc" ANT=ant PYTHON=python NUM_FILES=8 && \
cd ../../
RUN apt-get remove -y gpg-agent ant jcc build-essential && \
apt-get purge --auto-remove -y && \
apt-get clean
WORKDIR /usr/src
RUN rm -rf pylucene
RUN python -c "import lucene; lucene.initVM()"
# ======================== END OF ADDITIONAL INSTALLATION ========================
WORKDIR /app
COPY . .