File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23 as build
2
+
3
+ ARG TARGETPLATFORM
4
+ ARG BUILDPLATFORM
5
+ ARG TARGETOS
6
+ ARG TARGETARCH
7
+
8
+ ARG VERSION
9
+ ARG GIT_COMMIT
10
+ ARG PUBLIC_KEY
11
+
12
+ ENV CGO_ENABLED=0
13
+ ENV GO111MODULE=on
14
+ ENV GOFLAGS=-mod=vendor
15
+
16
+ WORKDIR /go/src/github.com/self-actuated/slicer-ssh-agent
17
+ COPY . .
18
+
19
+ # RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test -v ./...
20
+
21
+ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
22
+ --ldflags "-s -w -X 'main.Version=${VERSION}' -X 'main.GitCommit=${GIT_COMMIT}'" \
23
+ -o slicer-ssh-agent .
24
+
25
+ FROM --platform=${TARGETPLATFORM:-linux/amd64} scratch as ship
26
+
27
+ COPY --from=build /go/src/github.com/self-actuated/slicer-ssh-agent/slicer-ssh-agent /
28
+
29
+ CMD ["/slicer-ssh-agent" ]
You can’t perform that action at this time.
0 commit comments