-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 859 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 859 Bytes
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
# This Dockerfile utilizes a multi-stage builds
ARG ALPINE_VERSION=3.19
FROM golang:1.20-alpine$ALPINE_VERSION AS builder
ARG TARGETARCH
ARG TARGETOS
# Install necessary build tools
RUN apk --update add make bash curl git
# Switch workdir, otherwise we end up in /go (default)
WORKDIR /
# Copy everything into build container
COPY . .
# Build the application
RUN make build/$TARGETOS-$TARGETARCH
# Now in 2nd build stage
FROM library/alpine:$ALPINE_VERSION
ARG TARGETARCH
ARG TARGETOS
# Necessary depedencies
RUN apk --update add bash curl ca-certificates && update-ca-certificates
# Install binary
COPY --from=builder /build/plumber-$TARGETOS-$TARGETARCH /plumber-linux
COPY --from=builder /docker-entrypoint.sh /docker-entrypoint.sh
RUN ln -s /plumber-linux /usr/bin/plumber
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/plumber-linux", "server"]