This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile
72 lines (64 loc) · 2.39 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
FROM eclipse-temurin:8-jre
ENV STORM_CONF_DIR=/conf \
STORM_DATA_DIR=/data \
STORM_LOG_DIR=/logs
# Add a user with an explicit UID/GID and create necessary directories
RUN set -eux; \
groupadd -r storm --gid=1000; \
useradd -r -g storm --uid=1000 storm; \
mkdir -p "$STORM_CONF_DIR" "$STORM_DATA_DIR" "$STORM_LOG_DIR"; \
chown -R storm:storm "$STORM_CONF_DIR" "$STORM_DATA_DIR" "$STORM_LOG_DIR"``
# Install required packages
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
bash \
ca-certificates \
dirmngr \
gosu \
gnupg \
python2 \
procps \
wget; \
rm -rf /var/lib/apt/lists/*; \
# Verify that gosu binary works
gosu nobody true; \
# Set default version to Python 2
update-alternatives --install /usr/bin/python python /usr/bin/python2 0
ARG GPG_KEY=5167DE337E7370373499FC1DA4A672F11B5050C8
ARG DISTRO_NAME=apache-storm-1.2.4
# Download Apache Storm, verify its PGP signature, untar and clean up
RUN set -eux; \
ddist() { \
local f="$1"; shift; \
local distFile="$1"; shift; \
local success=; \
local distUrl=; \
for distUrl in \
'https://www.apache.org/dyn/closer.cgi?action=download&filename=' \
https://www-us.apache.org/dist/ \
https://www.apache.org/dist/ \
https://archive.apache.org/dist/ \
; do \
if wget -q -O "$f" "$distUrl$distFile" && [ -s "$f" ]; then \
success=1; \
break; \
fi; \
done; \
[ -n "$success" ]; \
}; \
ddist "$DISTRO_NAME.tar.gz" "storm/$DISTRO_NAME/$DISTRO_NAME.tar.gz"; \
ddist "$DISTRO_NAME.tar.gz.asc" "storm/$DISTRO_NAME/$DISTRO_NAME.tar.gz.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --keyserver hkps://keyserver.pgp.com --recv-key "$GPG_KEY" || \
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys "$GPG_KEY" || \
gpg --keyserver hkps://pgp.mit.edu --recv-keys "$GPG_KEY"; \
gpg --batch --verify "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz"; \
tar -xzf "$DISTRO_NAME.tar.gz"; \
rm -rf "$GNUPGHOME" "$DISTRO_NAME.tar.gz" "$DISTRO_NAME.tar.gz.asc"; \
chown -R storm:storm "$DISTRO_NAME"
WORKDIR $DISTRO_NAME
ENV PATH $PATH:/$DISTRO_NAME/bin
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]