diff --git a/Dockerfile b/Dockerfile index 682392656..279fbb3f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,8 @@ COPY cmd/ cmd/ # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build -tags ${GO_BUILD_TAGS} -a -ldflags="-X github.com/kyma-project/istio/operator/internal/resources.version=${VERSION}" -o manager main.go -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build -a -o istio_install cmd/istio-install/main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build -tags ${GO_BUILD_TAGS} -ldflags="-s -w -X github.com/kyma-project/istio/operator/internal/resources.version=${VERSION}" -o manager main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build -ldflags="-s -w" -o istio_install cmd/istio-install/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details