diff --git a/obfs4/Containerfile b/obfs4/Containerfile index 77fc803..f64499b 100644 --- a/obfs4/Containerfile +++ b/obfs4/Containerfile @@ -8,7 +8,7 @@ ARG TARGETOS TARGETARCH COPY --from=source /go/src /go/src WORKDIR /go/src/obfs4proxy RUN --mount=type=cache,target=/go/pkg go mod download -RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -buildvcs=false -ldflags '-w -s -buildid=' -trimpath `if [[ "$TARGETARCH" != "arm" ]]; then echo "-buildmode=pie"; fi` . +RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -buildvcs=false -ldflags '-w -s -buildid=' -trimpath . FROM scratch COPY --from=build /go/src/obfs4proxy/obfs4proxy /obfs4proxy diff --git a/snowflake-standalone/Containerfile b/snowflake-standalone/Containerfile index c96e5f1..d7eea61 100644 --- a/snowflake-standalone/Containerfile +++ b/snowflake-standalone/Containerfile @@ -8,7 +8,7 @@ ARG TARGETOS TARGETARCH COPY --from=source /go/src /go/src WORKDIR /go/src/proxy RUN --mount=type=cache,target=/go/pkg go mod download -RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -buildvcs=false -ldflags '-w -s -buildid=' -trimpath `if [[ "$TARGETARCH" != "arm" ]]; then echo "-buildmode=pie"; fi` . +RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -buildvcs=false -ldflags '-w -s -buildid=' -trimpath . FROM docker.io/library/alpine:latest RUN apk -U upgrade --no-cache diff --git a/snowflake/Containerfile b/snowflake/Containerfile index 89addee..96a7200 100644 --- a/snowflake/Containerfile +++ b/snowflake/Containerfile @@ -8,7 +8,7 @@ ARG TARGETOS TARGETARCH COPY --from=source /go/src /go/src WORKDIR /go/src/client RUN --mount=type=cache,target=/go/pkg go mod download -RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -buildvcs=false -ldflags '-w -s -buildid=' -trimpath `if [[ "$TARGETARCH" != "arm" ]]; then echo "-buildmode=pie"; fi` . +RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -buildvcs=false -ldflags '-w -s -buildid=' -trimpath . FROM scratch COPY --from=build /go/src/client/client /client