-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 744 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 744 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
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.26-alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG GIT_COMMIT
ARG VERSION
ENV GO111MODULE=on
ENV GOFLAGS=-mod=vendor
ENV CGO_ENABLED=0
WORKDIR /usr/bin/
WORKDIR /go/src/github.com/inlets/mixctl
COPY . .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 \
go build --ldflags "-s -w \
-X github.com/inlets/mixctl/version.GitCommit=${GIT_COMMIT} \
-X github.com/inlets/mixctl/version.Version=${VERSION} \
-X github.com/inlets/mixctl/version.Platform=${TARGETARCH}" \
-o /usr/bin/mixctl
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.23.4 as release
COPY --from=builder /usr/bin/mixctl /
ENTRYPOINT ["/mixctl"]