diff --git a/Makefile b/Makefile index c9b3361d82e6b..6edd539aa3b70 100644 --- a/Makefile +++ b/Makefile @@ -349,7 +349,7 @@ ifeq ($(DEV_IMAGE), true) IMAGE_TAG="dev-$(shell git describe --always --dirty)" image: build-ui DOCKER_BUILDKIT=1 $(DOCKER) build --platform=$(TARGET_ARCH) -t argocd-base --target argocd-base . - CGO_ENABLED=${CGO_FLAG} GOOS=linux GOARCH=amd64 GODEBUG="tarinsecurepath=0,zipinsecurepath=0" go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd ./cmd + GOOS=linux GOARCH=$(TARGET_ARCH:linux/%=%) GODEBUG="tarinsecurepath=0,zipinsecurepath=0" go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd ./cmd ln -sfn ${DIST_DIR}/argocd ${DIST_DIR}/argocd-server ln -sfn ${DIST_DIR}/argocd ${DIST_DIR}/argocd-application-controller ln -sfn ${DIST_DIR}/argocd ${DIST_DIR}/argocd-repo-server diff --git a/docs/developer-guide/running-locally.md b/docs/developer-guide/running-locally.md index faf66ed0fc6a3..fc39d0d127709 100644 --- a/docs/developer-guide/running-locally.md +++ b/docs/developer-guide/running-locally.md @@ -222,6 +222,18 @@ Then you can build & push the image in one step: DOCKER_PUSH=true make image ``` +To speed up building of images you may use the DEV_IMAGE option that builds the argocd binaries in the users desktop environment +(instead of building everything in Docker) and copies them into the result image: + +```bash +DEV_IMAGE=true DOCKER_PUSH=true make image +``` + +> [!NOTE] +> The first run of this build task may take a long time because it needs first to build the base image first; however, +> once it's done, the build process should be much faster than a regular full image build in Docker. + + #### Configure manifests for your image With `IMAGE_REGISTRY`, `IMAGE_NAMESPACE` and `IMAGE_TAG` still set, run: