Skip to content

Commit f238795

Browse files
committed
[feat] docker - switching to using ubuntu for base image
Dropping alpine linux, in favor of ubuntu. Tackling security concerns Ticket: https://mattermost.atlassian.net/browse/CLD-7097
1 parent 4f8640c commit f238795

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

docker/Dockerfile

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1-
FROM alpine:3.15 AS TMP
1+
FROM ubuntu:noble-20240127.1@sha256:36fa0c7153804946e17ee951fdeffa6a1c67e5088438e5b90de077de5c600d4c AS TMP
22

3-
WORKDIR /mattermost-push-proxy
3+
# Setting bash as our shell, and enabling pipefail option
4+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
45

6+
# Copying binaries
7+
WORKDIR /mattermost-push-proxy
58
COPY dist/ dist/
69
COPY docker/entrypoint .
7-
810
ARG ARCH
911
COPY bin/mattermost-push-proxy-linux-$ARCH bin/mattermost-push-proxy
1012

11-
FROM alpine:3.15
13+
#Using multi stage build
14+
FROM ubuntu:noble-20240127.1@sha256:36fa0c7153804946e17ee951fdeffa6a1c67e5088438e5b90de077de5c600d4c
1215

13-
# hadolint ignore=DL3018
14-
RUN apk add --no-cache \
16+
# Install needed packages and indirect dependencies
17+
# hadolint ignore=DL3008
18+
RUN apt-get update \
19+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
1520
ca-certificates \
16-
libc6-compat \
1721
libffi-dev \
18-
linux-headers \
1922
netcat-openbsd \
2023
tzdata \
21-
&& rm -rf /tmp/* \
24+
&& rm -rf /var/lib/apt/lists/* \
2225
&& mkdir -p mattermost-push-proxy/bin \
2326
&& chown -R nobody:nogroup /mattermost-push-proxy
2427

28+
# Coyping needed files from previous stage
2529
COPY --from=TMP /mattermost-push-proxy/dist /
2630
COPY --from=TMP /mattermost-push-proxy/bin/ /mattermost-push-proxy/bin/
2731
COPY --from=TMP /mattermost-push-proxy/entrypoint /usr/local/bin/
2832

2933
USER nobody
30-
3134
WORKDIR /mattermost-push-proxy
32-
3335
ENV PUSH_PROXY=/mattermost-push-proxy/bin/mattermost-push-proxy
34-
3536
EXPOSE 8066
36-
3737
VOLUME ["/mattermost-push-proxy/config", "/mattermost-push-proxy/certs"]
38-
3938
ENTRYPOINT ["/usr/local/bin/entrypoint"]

0 commit comments

Comments
 (0)