-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile
101 lines (87 loc) · 3.87 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
FROM maven:3.6.3-jdk-11 AS BUILD
ENV ANT_VERSION=1.10.9
ENV ANT_HOME=/opt/ant
# Temporary Workaround to Surefire issue
ENV _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true
# change to tmp folder
WORKDIR /tmp
# Download and extract apache ant to opt folder
RUN wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz \
&& wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz.sha512 \
&& echo "$(cat apache-ant-${ANT_VERSION}-bin.tar.gz.sha512) apache-ant-${ANT_VERSION}-bin.tar.gz" | sha512sum -c \
&& tar -zxf apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt/ \
&& ln -s /opt/apache-ant-${ANT_VERSION} /opt/ant \
&& rm -f apache-ant-${ANT_VERSION}-bin.tar.gz \
&& rm -f apache-ant-${ANT_VERSION}-bin.tar.gz.sha512
# add executables to path
RUN update-alternatives --install "/usr/bin/ant" "ant" "/opt/ant/bin/ant" 1 && \
update-alternatives --set "ant" "/opt/ant/bin/ant"
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
# TODO : add specific COPY
COPY . .
#COPY datafari-ce datafari-ce
#COPY datafari-ee/datafari-zookeeper datafari-ee/datafari-zookeeper
#COPY datafari-ee/datafari-zookeeper-mcf datafari-ee/datafari-zookeeper-mcf
#COPY .drone.yml .drone.yml
#COPY datafari-ee/CHANGES.txt datafari-ee/CHANGES.txt
#COPY datafari-ee/LICENSE.txt datafari-ee/LICENSE.txt
#COPY datafari-ee/README.txt datafari-ee/README.txt
#COPY datafari-ee/pom.xml datafari-ee/pom.xml
#COPY .git .git
RUN mvn -f pom.xml -DfailIfNoTests=false -Dtest='!TestDataServices' -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install
RUN ls
#COPY datafari-ee/apache apache
RUN ls
#COPY datafari-ee/bin/common bin/common
#COPY datafari-ee/linux linux
#COPY datafari-ee/opensearch opensearch
#COPY datafari-ee/ssl-keystore ssl-keystore
RUN ant clean-build -f ./linux/build.xml
FROM eclipse-temurin:11-jdk-jammy
MAINTAINER Olivier Tavard FRANCE LABS <olivier.tavard@francelabs.com>
ENV DATAFARIUIDEV=false
# temporary allow unauthenticatedparameter due to debian repo issue
RUN echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections
RUN echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections
RUN apt-get update && apt-get install --allow-unauthenticated -y \
wget \
curl \
jq \
debconf \
python3 \
python-is-python3 \
sudo \
vim \
nano \
netcat \
libc6-dev \
unzip \
lsof \
procps \
apache2 \
libapache2-mod-jk \
iptables \
iptables-persistent \
systemd \
zip \
iputils-ping \
bc \
netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
# For dev
RUN echo "export LANG=C.UTF-8" >> /etc/profile
RUN echo "export JAVA_HOME=/usr/local/openjdk-11" >> /etc/profile
RUN echo "export PATH=$JAVA_HOME/bin:$PATH" >> /etc/profile
RUN echo "export LOG4J_FORMAT_MSG_NO_LOOKUPS=true" >> /etc/profile
WORKDIR /var/datafari
RUN useradd datafari -m -s /bin/bash
#COPY --chown=datafari:root --from=BUILD /tmp/datafari/linux/installer/build/datafari/opt/datafari .
COPY --from=BUILD /tmp/linux/installer/dist/datafari.deb /var/datafari/datafari.deb
RUN DEBIAN_FRONTEND=noninteractive dpkg -i datafari.deb
EXPOSE 8080 8983 9080 5601 9200 80 443
WORKDIR /opt/datafari
#RUN chmod -R 775 /opt/datafari/bin/deployUtils/docker
RUN sed -i -e 's/sleep 10/sleep 30/g' /opt/datafari/bin/start-datafari.sh
CMD ["/bin/bash", "-c", "/opt/datafari/bin/deployUtils/docker/debian-start-datafari.sh"]