-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (42 loc) · 1.35 KB
/
Dockerfile
File metadata and controls
55 lines (42 loc) · 1.35 KB
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
FROM golang:1.17.6 AS builder
ENV HUB_VERSION 2.14.2
WORKDIR /opt/hub
RUN curl -sSLo hub.tgz https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-linux-amd64-${HUB_VERSION}.tgz \
&& tar xzf hub.tgz \
&& mv hub-linux-amd64-${HUB_VERSION}/bin/hub .
WORKDIR /go/src/mattermod
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 make build-mattermod
################
FROM ubuntu:jammy-20240405@sha256:6f6ec53d36a9504f01e3636cf68e0e03761a3b6947a95ba430ae553ee3aaf4d9
RUN export DEBIAN_FRONTEND="noninteractive" \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install --no-install-recommends -y ca-certificates ssh-client git \
&& apt-get clean all \
&& rm -rf /var/cache/apt/
RUN groupadd \
--gid 1000 mattermod \
&& useradd \
--home-dir /app \
--create-home \
--uid 1000 \
--gid 1000 \
--shell /bin/sh \
--skel /dev/null \
mattermod \
&& chown -R mattermod:mattermod /app
COPY --from=builder /opt/hub/hub /usr/local/bin/hub
COPY --from=builder /go/src/mattermod/dist/mattermod /usr/local/bin/
COPY --from=builder /go/src/mattermod/hack/cherry-pick.sh /app/scripts/
WORKDIR /app
RUN for d in .ssh repos logs; do \
mkdir -p /app/${d} ; \
chown -R mattermod:mattermod /app/${d}/ ; \
done
USER mattermod
EXPOSE 8080 9000
ENTRYPOINT ["mattermod"]