-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
144 lines (127 loc) · 4.53 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
FROM ubuntu:noble-20241011
RUN apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get -y install --no-install-recommends \
bzip2 \
ca-certificates \
curl \
git \
gnupg \
jq \
libc6-dev \
maven \
mysql-client \
netbase \
openjdk-11-jre \
python3 \
python3-pip \
tini \
tzdata \
&& apt-get upgrade -y \
&& apt-get clean
ENV PHANTOMJS_VERSION 2.1.1
ENV OPENSSL_CONF /etc/ssl
RUN curl -Ss --location -o- https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 | tar -C /tmp --no-same-permissions -xjf- \
&& mv /tmp/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64/bin/phantomjs /usr/bin \
&& chmod +x /usr/bin/phantomjs
# Chromium dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get -y install --no-install-recommends \
fontconfig \
fonts-freefont-otf \
fonts-liberation \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcairo-gobject2 \
libcairo2 \
libcolord2 \
libdatrie1 \
libdeflate0 \
libepoxy0 \
libfontconfig1 \
libfribidi0 \
libgbm1 \
libgdk-pixbuf-2.0-0 \
libgdk-pixbuf2.0-common \
libgtk-3-0 \
libgtk-3-common \
libjbig0 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libpangoft2-1.0-0 \
libpixman-1-0 \
libthai-data \
libthai0 \
libtiff6 \
libu2f-udev \
libvulkan1 \
libwayland-client0 \
libwayland-cursor0 \
libwayland-egl1 \
libwayland-server0 \
libwebp7 \
libxcb-render0 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxinerama1 \
libxkbcommon0 \
libxrandr2 \
python3-boto3 \
shared-mime-info \
ubuntu-mono \
unzip \
wget \
xdg-utils \
xkb-data \
&& apt-get clean
ENV CHROME_VERSION 97.0.4692.99-1
# Dirty fix due to unavailability of the upper chrome version
COPY chrome.deb /tmp/chrome.deb
RUN curl -Ss https://dl.google.com/linux/linux_signing_key.pub > /etc/apt/trusted.gpg.d/google-chrome.asc \
&& echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update
RUN apt install --yes --no-install-recommends /tmp/chrome.deb \
&& apt-get clean
COPY chromium /usr/bin
RUN chmod +x /usr/bin/chromium
COPY assume_role_exec /usr/bin
RUN groupadd looker && useradd -m -g looker -s /bin/bash looker
ENV HOME /opt/looker
ENV LOOKER_DIR /opt/looker
RUN mkdir -p $HOME
RUN mkdir -p $LOOKER_DIR
WORKDIR $HOME
ARG LOOKER_VERSION
ENV LOOKER_VERSION $LOOKER_VERSION
COPY looker.jar $LOOKER_DIR
COPY looker-dependencies.jar $LOOKER_DIR
RUN update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
ENV JMX_EXPORTER_VERSION 1.0.1
RUN mvn dependency:get \
-DremoteRepositories=http://repo1.maven.org/maven2/ \
-DgroupId=io.prometheus.jmx \
-DartifactId=jmx_prometheus_javaagent \
-Dversion=${JMX_EXPORTER_VERSION} \
-Dtransitive=false \
&& mvn dependency:copy \
-Dartifact=io.prometheus.jmx:jmx_prometheus_javaagent:${JMX_EXPORTER_VERSION} \
-DoutputDirectory=$LOOKER_DIR \
&& mv $LOOKER_DIR/jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar $LOOKER_DIR/jmx_prometheus_javaagent.jar
COPY jmx_prometheus_javaagent.yaml $LOOKER_DIR/jmx_prometheus_javaagent.yaml
RUN chown -R looker:looker $HOME /home/looker
ENV PORT 9999
ENV LOOKERPORT 9999
EXPOSE 9999
ENV API_PORT 19999
EXPOSE 19999
# unused, add it to JAVAARGS to set up JMX monitoring
ENV JMXARGS "-Dcom.sun.akuma.jvmarg.com.sun.management.jmxremote -Dcom.sun.akuma.jvmarg.com.sun.management.jmxremote.port=9910 -Dcom.sun.akuma.jvmarg.com.sun.management.jmxremote.ssl=false -Dcom.sun.akuma.jvmarg.com.sun.management.jmxremote.local.only=false -Dcom.sun.akuma.jvmarg.com.sun.management.jmxremote.authenticate=true -Dcom.sun.akuma.jvmarg.com.sun.management.jmxremote.access.file=$HOME/.lookerjmx/jmxremote.access -Dcom.sun.akuma.jvmarg.com.sun.management.jmxremote.password.file=$HOME/.lookerjmx/jmxremote.password"
# Disable javaagent by default, will be activable as an option in chart
# ENV JAVAARGS "-Dlog4j.formatMsgNoLookups=true -javaagent:$LOOKER_DIR/jmx_prometheus_javaagent.jar=8080:$LOOKER_DIR/jmx_prometheus_javaagent.yaml"
ENV JAVAARGS "-Dlog4j.formatMsgNoLookups=true"
ENV JAVAJVMARGS "-XX:+UseG1GC -XX:MaxGCPauseMillis=2000 -XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"
ENV LOOKERARGS "--no-daemonize --log-format=json --no-log-to-file"
ENV LOOKEREXTRAARGS ""
ENV PROTOCOL "https"
USER looker
CMD exec tini -- assume_role_exec java $JAVAJVMARGS $JAVAARGS -jar $LOOKER_DIR/looker.jar start $LOOKERARGS $LOOKEREXTRAARGS