forked from elastic/fleet-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.build
More file actions
22 lines (19 loc) · 751 Bytes
/
Dockerfile.build
File metadata and controls
22 lines (19 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
ARG GO_VERSION
ARG SUFFIX # Should be main-debian11 or arm
FROM docker.elastic.co/beats-dev/golang-crossbuild:${GO_VERSION}-${SUFFIX}
RUN \
apt-get update \
&& apt-get install --no-install-recommends -y zip \
&& apt-get clean
RUN groupadd --gid 1000 fleet-server && \
useradd -M -d /fleet-server/ --uid 1000 --gid 1000 fleet-server
USER fleet-server
WORKDIR /fleet-server/
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
RUN go install github.com/magefile/mage # uses version in go.mod
ENV PATH="$PATH:/go/bin"
ENV MAGEFILE_CACHE=/fleet-server/build/.magefile
ENTRYPOINT [ "mage" ]
CMD [ "build:release" ]