-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
120 lines (94 loc) · 5.08 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
FROM ubuntu:18.04
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG KIBANA_VERSION=7.7.1
###############################################################################
# INSTALLATION
###############################################################################
### install prerequisites
# RUN set -x \
RUN set -e \
&& apt update -y \
&& apt install -y --no-install-recommends ca-certificates \
&& apt install -y --no-install-recommends curl \
&& apt install -y --no-install-recommends gosu \
&& apt install -y --no-install-recommends wget \
&& apt install -y --no-install-recommends libkrb5-dev \
&& apt install -y --no-install-recommends git \
&& apt install -y --no-install-recommends libfontconfig
RUN set -e \
&& apt install -y --no-install-recommends python \
&& DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends krb5-config \
&& apt install -y --no-install-recommends libssl-dev
RUN set -e \
&& apt install -y --no-install-recommends libsasl2-dev \
&& apt install -y --no-install-recommends libsasl2-modules-gssapi-mit \
&& apt install -y --no-install-recommends gcc
RUN set -e \
&& apt install -y --no-install-recommends libc-dev \
&& apt install -y --no-install-recommends make \
&& apt install -y --no-install-recommends g++ \
&& apt install -y --no-install-recommends build-essential
RUN set -e \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
# && gosu nobody true
# && set +x
### install Kibana
ENV \
KIBANA_HOME=/opt/kibana \
KIBANA_PACKAGE=kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz \
KIBANA_GID=993 \
KIBANA_UID=993
RUN mkdir ${KIBANA_HOME} \
&& curl -O https://artifacts.elastic.co/downloads/kibana/${KIBANA_PACKAGE} \
&& tar xzf ${KIBANA_PACKAGE} -C ${KIBANA_HOME} --strip-components=1 \
&& rm -f ${KIBANA_PACKAGE} \
&& groupadd -r kibana -g ${KIBANA_GID} \
&& useradd -r -s /usr/sbin/nologin -d ${KIBANA_HOME} -c "Kibana service user" -u ${KIBANA_UID} -g kibana kibana \
&& mkdir -p /var/log/kibana \
&& chown -R kibana:kibana ${KIBANA_HOME} /var/log/kibana
###############################################################################
# START-UP SCRIPTS
###############################################################################
### Kibana
# ADD ./kibana-init /etc/init.d/kibana
# RUN sed -i -e 's#^KIBANA_HOME=$#KIBANA_HOME='$KIBANA_HOME'#' /etc/init.d/kibana \
# && chmod +x /etc/init.d/kibana
### NodeJS version 10.19.0 is required for Kibana version 7.7.0. Delete node distribution included with kibana and replace with manually installed version
RUN set -x \
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ] ; then rm -rf /opt/kibana/node \
&& curl -O https://nodejs.org/dist/v10.19.0/node-v10.19.0-linux-armv6l.tar.gz \
&& tar -xvf node-v10.19.0-linux-armv6l.tar.gz \
&& mv node-v10.19.0-linux-armv6l /opt/kibana/node ; fi
RUN set -x \
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ] ; then rm -rf /opt/kibana/node \
&& curl -O https://nodejs.org/dist/v10.19.0/node-v10.19.0-linux-arm64.tar.gz \
&& tar -xvf node-v10.19.0-linux-arm64.tar.gz \
&& mv node-v10.19.0-linux-arm64 /opt/kibana/node ; fi
#RUN set -x \
# && if [ "${TARGETPLATFORM}" = "linux/arm/v7" ] ; then git clone --branch v0.25.0 --depth 1 https://github.com/nodegit/nodegit.git \
# && cd /nodegit \
# && wget https://github.com/fg2it/phantomjs-on-raspberry/releases/download/v2.1.1-wheezy-jessie-armv6/phantomjs \
# && export PATH=$PATH:/nodegit:/opt/kibana/node/bin/ \
# && chmod -R 777 /nodegit ; fi
# && /opt/kibana/node/bin/npm install --unsafe-perm ; fi
# RUN set -x \
# && if [ "${TARGETPLATFORM}" = "linux/arm/v7" ] ; then mv /opt/kibana/node_modules/@elastic/nodegit/build/Release /opt/kibana/node_modules/@elastic/nodegit/build/Release.old \
# && mv /opt/kibana/node_modules/@elastic/nodegit/dist/enums.js /opt/kibana/node_modules/@elastic/nodegit/dist/enums.js.old \
# && cp -rf /nodegit/build/Release /opt/kibana/node_modules/@elastic/nodegit/build \
# && cp /nodegit/dist/enums.js /opt/kibana/node_modules/@elastic/nodegit/dist ; fi
#RUN set -x \
# && if [ "${TARGETPLATFORM}" = "linux/arm/v7" ] ; then cd /nodegit \
# && export PATH=$PATH:/nodegit:/opt/kibana/node/bin/ \
# && /opt/kibana/node/bin/npm install ctags --unsafe-perm ; fi
#RUN set -x \
# && if [ "${TARGETPLATFORM}" = "linux/arm/v7" ] ; then mv /opt/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-x64 /opt/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm \
# && mv /opt/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm/ctags.node /opt/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm/ctags.node.old \
# && cp /nodegit/node_modules/ctags/build/Release/ctags.node /opt/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm ; fi
USER ${KIBANA_UID}
# RUN cd /root && curl -O https://nodejs.org/dist/v10.15.2/node-v10.15.2-linux-armv6l.tar.gz && tar -xvf node-v10.15.2-linux-armv6l.tar.gz
# ADD ./kibana.sh /opt/kibana/bin/kibana
WORKDIR /opt/kibana
RUN chmod a+x /opt/kibana/bin/kibana
CMD ["/opt/kibana/bin/kibana"]