forked from faberchri/fast-data-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-singlestage
112 lines (99 loc) · 4.84 KB
/
Dockerfile-singlestage
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
FROM alpine
MAINTAINER Marios Andreopoulos <[email protected]>
# Part of the multistage build that we pushed back due to narrow support yet.
#COPY --from=compile-lkd /opt /opt
# Update, install tooling and some basic setup
RUN apk add --no-cache \
bash \
bash-completion \
bzip2 \
coreutils \
curl \
dumb-init \
gettext \
gzip \
jq \
libstdc++ \
openjdk8-jre-base \
openssl \
sqlite \
supervisor \
tar \
wget \
&& echo "progress = dot:giga" | tee /etc/wgetrc \
&& mkdir -p /opt \
&& mkdir /extra-connect-jars /connectors \
&& mkdir /etc/supervisord.d /etc/supervisord.templates.d
SHELL ["/bin/bash", "-c"]
WORKDIR /
# Tne next 3 lines are part of the single stage build.
ARG FDD_LKD_VERSION=1.0.1
ARG FDD_LKD_URL="https://archive.landoop.com/lkd/releases/LKD-${FDD_LKD_VERSION}.tar.gz"
RUN wget "$FDD_LKD_URL" -O /lkd.tgz \
&& tar -xzf /lkd.tgz -C /opt \
&& rm -f /lkd.tgz
# Install external tooling
# checkport: checks for ports that are already in use, useful when we run with
# '--net=host so we have an easy way to detect if our ports are free
# quickcert: a small tool we use to create a CA and key-cert pairs so we can easily
# setup SSL on the brokers with autogenerated keys and certs
# glibc : alpine linux has an embedded libc which misses some functions that are
# needed by some apps (e.g jvm's rocksdb jni — HDFS connector, Lenses, etc),
# so we add glibc to make them work
# https://github.com/sgerrand/alpine-pkg-glibc
# caddy : an excellent web server we use to serve fast-data-dev UI, proxy various REST
# endpoints, etc
# https://github.com/mholt/caddy
ARG CHECKPORT_URL="https://gitlab.com/andmarios/checkport/uploads/3903dcaeae16cd2d6156213d22f23509/checkport"
ARG QUICKCERT_URL="https://github.com/andmarios/quickcert/releases/download/1.0/quickcert-1.0-linux-amd64-alpine"
ARG GLIBC_INST_VERSION="2.27-r0"
ARG CADDY_URL=https://github.com/mholt/caddy/releases/download/v0.10.10/caddy_v0.10.10_linux_amd64.tar.gz
RUN wget "$CHECKPORT_URL" -O /usr/local/bin/checkport \
&& wget "$QUICKCERT_URL" -O /usr/local/bin/quickcert \
&& chmod 0755 /usr/local/bin/quickcert /usr/local/bin/checkport \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_INST_VERSION}/glibc-${GLIBC_INST_VERSION}.apk \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_INST_VERSION}/glibc-bin-${GLIBC_INST_VERSION}.apk \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_INST_VERSION}/glibc-i18n-${GLIBC_INST_VERSION}.apk \
&& apk add --no-cache --allow-untrusted glibc-${GLIBC_INST_VERSION}.apk glibc-bin-${GLIBC_INST_VERSION}.apk glibc-i18n-${GLIBC_INST_VERSION}.apk \
&& rm -f glibc-${GLIBC_INST_VERSION}.apk glibc-bin-${GLIBC_INST_VERSION}.apk glibc-i18n-${GLIBC_INST_VERSION}.apk \
&& wget "$CADDY_URL" -O /caddy.tgz \
&& mkdir -p /opt/caddy \
&& tar xzf /caddy.tgz -C /opt/caddy \
&& rm -f /caddy.tgz
COPY /filesystem /
RUN chmod +x /usr/local/bin/{smoke-tests,logs-to-kafka,nullsink}.sh \
/usr/local/share/landoop/sample-data/*.sh
# Create system symlinks to Kafka binaries
RUN bash -c 'for i in $(find /opt/landoop/kafka/bin /opt/landoop/tools/bin -maxdepth 1 -type f); do ln -s $i /usr/local/bin/$(echo $i | sed -e "s>.*/>>"); done'
# Setup Kafka Topics UI, Schema Registry UI, Kafka Connect UI
RUN mkdir -p \
/var/www/kafka-topics-ui \
/var/www/schema-registry-ui \
/var/www/kafka-connect-ui \
&& tar -xf /opt/landoop/tools/share/kafka-topics-ui/kafka-topics-ui.tar.gz \
-C /var/www/kafka-topics-ui \
--exclude=env.js \
&& tar -xf /opt/landoop/tools/share/schema-registry-ui/schema-registry-ui.tar.gz \
-C /var/www/schema-registry-ui \
--exclude=env.js \
&& tar -xf /opt/landoop/tools/share/kafka-connect-ui/kafka-connect-ui.tar.gz \
-C /var/www/kafka-connect-ui \
--exclude=env.js
RUN ln -s /var/log /var/www/logs
# Add executables, settings and configuration
ADD setup-and-run.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/setup-and-run.sh \
&& ln -s /usr/local/share/landoop/etc/bashrc /root/.bashrc
VOLUME ["/data"]
ARG BUILD_BRANCH
ARG BUILD_COMMIT
ARG BUILD_TIME
ARG DOCKER_REPO=local
RUN echo "BUILD_BRANCH=${BUILD_BRANCH}" | tee /build.info \
&& echo "BUILD_COMMIT=${BUILD_COMMIT}" | tee -a /build.info \
&& echo "BUILD_TIME=${BUILD_TIME}" | tee -a /build.info \
&& echo "DOCKER_REPO=${DOCKER_REPO}" | tee -a /build.info \
&& sed -e 's/^/FDD_/' /opt/landoop/build.info | tee -a /build.info
EXPOSE 2181 3030 3031 8081 8082 8083 9092
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/usr/local/bin/setup-and-run.sh"]