Skip to content

Commit 36d9143

Browse files
committed
cerebro 0.7
1 parent 9cdaee0 commit 36d9143

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

cerebro/0.7/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM openjdk:8-jre
2+
3+
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
4+
RUN groupadd -r cerebro && useradd -r -g cerebro cerebro
5+
6+
# grab gosu for easy step-down from root
7+
ENV GOSU_VERSION 1.7
8+
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
9+
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
10+
&& gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
11+
&& gpg --verify /usr/local/bin/gosu.asc \
12+
&& rm /usr/local/bin/gosu.asc \
13+
&& chmod +x /usr/local/bin/gosu \
14+
&& gosu nobody true
15+
16+
ENV CEREBRO_VERSION 0.7.2
17+
ENV CEREBRO_SHA256 c3f019bd29832550d5ce15d51cf9e4b52c270daca9f35d7602fa06f1ecfa9b4a
18+
RUN cd /tmp \
19+
&& curl -o cerebro-${CEREBRO_VERSION}.tgz -SL "https://github.com/lmenezes/cerebro/releases/download/v${CEREBRO_VERSION}/cerebro-${CEREBRO_VERSION}.tgz" \
20+
&& echo "$CEREBRO_SHA256 /tmp/cerebro-${CEREBRO_VERSION}.tgz" | sha256sum -c - \
21+
&& tar zxvf /tmp/cerebro-${CEREBRO_VERSION}.tgz \
22+
&& mkdir /tmp/cerebro-${CEREBRO_VERSION}/logs \
23+
&& mv /tmp/cerebro-${CEREBRO_VERSION} /opt/cerebro \
24+
&& rm /tmp/cerebro-${CEREBRO_VERSION}.tgz
25+
26+
WORKDIR /opt/cerebro
27+
28+
COPY docker-entrypoint.sh /docker-entrypoint.sh
29+
RUN chmod +x /docker-entrypoint.sh
30+
ENTRYPOINT ["/docker-entrypoint.sh"]
31+
32+
EXPOSE 9000
33+
34+
VOLUME ["/opt/cerebro/conf", "/opt/cerebro/logs"]
35+
36+
CMD ["bin/cerebro"]

cerebro/0.7/docker-entrypoint.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Add cerebro as command if needed
6+
if [ "${1:0:1}" = '-' ]; then
7+
set -- /opt/cerebro/bin/cerebro "$@"
8+
fi
9+
10+
# Drop root privileges if we are running cerebro
11+
# allow the container to be started with `--user`
12+
if [ "$1" = 'bin/cerebro' -a "$(id -u)" = '0' ]; then
13+
# Change the ownership of user-mutable directories to cerebro
14+
for path in \
15+
/opt/cerebro \
16+
; do
17+
chown -R cerebro:cerebro "$path" || true
18+
done
19+
20+
set -- gosu cerebro "$@"
21+
fi
22+
23+
# As argument is not related to cerebro,
24+
# then assume that user wants to run his own process,
25+
# for example a `bash` shell to explore this image
26+
exec "$@"

0 commit comments

Comments
 (0)