Skip to content

Commit

Permalink
Merge pull request #20 from jduepmeier/hardening
Browse files Browse the repository at this point in the history
Hardening
  • Loading branch information
moliware authored Jan 16, 2022
2 parents b5fccde + 7f4536e commit b631c36
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
FROM openjdk:11-jre-slim
FROM openjdk:11-jre-slim as builder

ENV CEREBRO_VERSION 0.9.4

RUN apt-get update \
&& apt-get install -y wget \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /opt/cerebro/logs \
&& wget -qO- https://github.com/lmenezes/cerebro/releases/download/v${CEREBRO_VERSION}/cerebro-${CEREBRO_VERSION}.tgz \
| tar xzv --strip-components 1 -C /opt/cerebro \
&& sed -i '/<appender-ref ref="FILE"\/>/d' /opt/cerebro/conf/logback.xml \
&& addgroup -gid 1000 cerebro \
&& adduser -gid 1000 -uid 1000 cerebro \
&& chown -R cerebro:cerebro /opt/cerebro
&& sed -i '/<appender-ref ref="FILE"\/>/d' /opt/cerebro/conf/logback.xml

FROM openjdk:11.0.13-jre-slim

COPY --from=builder /opt/cerebro /opt/cerebro

RUN addgroup -gid 1000 cerebro \
&& adduser -q --system --no-create-home --disabled-login -gid 1000 -uid 1000 cerebro \
&& chown -R root:root /opt/cerebro \
&& chown -R cerebro:cerebro /opt/cerebro/logs \
&& chown cerebro:cerebro /opt/cerebro

WORKDIR /opt/cerebro
USER cerebro
Expand Down

0 comments on commit b631c36

Please sign in to comment.