forked from questdb/questdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (59 loc) · 2.7 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 debian:bullseye
ARG tag_name
ENV GOSU_VERSION=1.14
ENV JDK_VERSION=17.0.7.7-1
RUN apt-get update \
&& apt-get install --no-install-recommends git curl wget gnupg2 ca-certificates lsb-release software-properties-common unzip -y
RUN wget -O- https://apt.corretto.aws/corretto.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/winehq.gpg >/dev/null && \
add-apt-repository 'deb https://apt.corretto.aws stable main' && \
apt-get update && \
apt-get install --no-install-recommends -y java-17-amazon-corretto-jdk=1:${JDK_VERSION} && \
apt-get -y install maven
ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto
WORKDIR /build
RUN echo tag_name ${tag_name:-master}
RUN git clone --depth=1 --progress --branch "${tag_name:-master}" --verbose https://github.com/questdb/questdb.git
WORKDIR /build/questdb
RUN mvn clean package -Djdk.lang.Process.launchMechanism=vfork -Dmaven.resolver.transport=wagon -Dmaven.wagon.httpconnectionManager.ttlSeconds=30 -DskipTests -P build-web-console,build-binaries
WORKDIR /build/questdb/core/target
RUN tar xvfz questdb-*-rt-*.tar.gz
RUN rm questdb-*-rt-*.tar.gz
RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" && \
wget -O gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" && \
export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && \
gpg --batch --verify gosu.asc gosu && \
gpgconf --kill all && \
rm -rf "$GNUPGHOME" gosu.asc && \
chmod +x gosu && \
./gosu --version && \
./gosu nobody true
FROM debian:bullseye-slim
WORKDIR /app
COPY --from=0 /build/questdb/core/target/questdb-*-rt-* .
COPY --from=0 /build/questdb/core/target/gosu /usr/local/bin/gosu
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Create questdb user and group
RUN groupadd -g 10001 questdb && \
useradd -u 10001 -g 10001 -d /var/lib/questdb -M -s /sbin/nologin questdb && \
mkdir -p /var/lib/questdb && \
chown -R questdb:questdb /var/lib/questdb
WORKDIR /var/lib/questdb
# Make port 9000 available to the world outside this container
EXPOSE 9000/tcp
EXPOSE 8812/tcp
EXPOSE 9009/tcp
#
# Run QuestDB when the container launches
#
# 'conf/log.conf' is a placeholder, it does not exist out of box
# which make logger use default configuration. However, when user configures
# a volume with something like:
#
# docker run -v "$(pwd):/var/lib/questdb/" questdb/questdb
#
# then one can create 'log.conf' in the 'conf' dir and override logger fully
#
ENTRYPOINT ["/docker-entrypoint.sh"]