Skip to content

Commit d8e9bab

Browse files
committed
Add dockerfile
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 823d985 commit d8e9bab

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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"]

0 commit comments

Comments
 (0)