diff --git a/Dockerfile b/Dockerfile index 98d7fa27a..fee81bbc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,18 +36,13 @@ RUN mkdir -p /.cache /.config ENV GOCACHE=/.cache ENV GOENV=/.config -# Copy and embed the helm charts -COPY charts/ charts/ -COPY hack/ hack/ -RUN go generate -tags embed_charts ./... - # Set home to "/" in order to for kubectl to automatically pick up vcluster kube config ENV HOME / # Build cmd RUN --mount=type=cache,id=gomod,target=/go/pkg/mod \ --mount=type=cache,id=gobuild,target=/.cache/go-build \ - CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -mod vendor -tags embed_charts -ldflags "-X github.com/loft-sh/vcluster/pkg/telemetry.SyncerVersion=$BUILD_VERSION -X github.com/loft-sh/vcluster/pkg/telemetry.telemetryPrivateKey=$TELEMETRY_PRIVATE_KEY" -o /vcluster cmd/vcluster/main.go + CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -mod vendor -ldflags "-X github.com/loft-sh/vcluster/pkg/telemetry.SyncerVersion=$BUILD_VERSION -X github.com/loft-sh/vcluster/pkg/telemetry.telemetryPrivateKey=$TELEMETRY_PRIVATE_KEY" -o /vcluster cmd/vcluster/main.go # RUN useradd -u 12345 nonroot # USER nonroot