-
Notifications
You must be signed in to change notification settings - Fork 42
/
Dockerfile
27 lines (20 loc) · 710 Bytes
/
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
FROM golang:1.20 as builder
WORKDIR /go/src/github.com/suborbital/e2core/
ARG VERSION="dev"
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
RUN go build -o .bin/e2core -tags netgo -ldflags="-extldflags=-static -X 'github.com/suborbital/e2core/e2core/release.Version=$VERSION'" .
FROM debian:buster-slim
RUN groupadd -g 999 e2core && \
useradd -r -u 999 -g e2core e2core && \
mkdir -p /home/e2core && \
chown -R e2core /home/e2core && \
chmod -R 700 /home/e2core
RUN apt-get update \
&& apt-get install -y ca-certificates
# e2core binary
COPY --from=builder /go/src/github.com/suborbital/e2core/.bin/e2core /usr/local/bin/
WORKDIR /home/e2core
USER e2core
CMD ["/usr/local/bin/e2core", "start"]