diff --git a/Dockerfile b/Dockerfile index d2b9ea72..894819f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,38 +1,49 @@ FROM docker.io/golang:1.24-bookworm as builder ARG VER=devel -ARG BUILDTAGS="" -ARG EXTERNAL="0" +ARG BUILDTAGS +ARG EXTERNAL=0 ENV CGO_ENABLED=0 -RUN mkdir -p /sshpiperd/plugins WORKDIR /src -RUN --mount=target=/src,type=bind,source=. --mount=type=cache,target=/root/.cache/go-build if [ "$EXTERNAL" = "1" ]; then cp sshpiperd /sshpiperd; else go build -o /sshpiperd -ldflags "-X main.mainver=$VER" ./cmd/... ; fi -RUN --mount=target=/src,type=bind,source=. --mount=type=cache,target=/root/.cache/go-build if [ "$EXTERNAL" = "1" ]; then cp -r plugins /sshpiperd ; else go build -o /sshpiperd/plugins -tags "$BUILDTAGS" ./plugin/... ./e2e/testplugin/...; fi +RUN \ + --mount=target=/src,type=bind,source=. \ + --mount=type=cache,target=/root/.cache/go-build \ + <