Removed go dependency on make
This commit is contained in:
24
clitools/docker/ctl-builder-local.Dockerfile
Normal file
24
clitools/docker/ctl-builder-local.Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM golang:1.26-alpine AS build
|
||||
|
||||
ARG VERSION
|
||||
ARG KUBE_VERSION
|
||||
ARG GIT_REV=unknown
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
RUN apk add --no-cache git build-base
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN test -f pkg/buildinfo/buildinfo_gen.go
|
||||
|
||||
RUN mkdir -p /out && \
|
||||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 \
|
||||
go build -trimpath -ldflags="-s -w" \
|
||||
-o /out/ctl-${VERSION} ./cmd/ctl
|
||||
|
||||
FROM scratch
|
||||
COPY --from=build /out/ /
|
||||
Reference in New Issue
Block a user