diff --git a/Dockerfile b/Dockerfile index 5ff315ff0ef2d..45bb628f1dff8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -117,12 +117,16 @@ RUN go mod download # Perform the build COPY . . -RUN make argocd-all ARG BUILD_ALL_CLIS=true RUN if [ "$BUILD_ALL_CLIS" = "true" ] ; then \ make BIN_NAME=argocd-darwin-amd64 GOOS=darwin argocd-all && \ - make BIN_NAME=argocd-windows-amd64.exe GOOS=windows argocd-all \ + make BIN_NAME=argocd-windows-amd64.exe GOOS=windows argocd-all && \ + make BIN_NAME=argocd-linux-amd64 GOOS=linux GOARCH=amd64 argocd-all && \ + make BIN_NAME=argocd-linux-arm64 GOOS=linux GOARCH=arm64 argocd-all && \ + cd dist && echo $(go env GOARCH) > argocd-arch \ + ; else \ + make argocd-all \ ; fi #################################################################################################### @@ -133,10 +137,14 @@ COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/l COPY --from=argocd-ui ./src/dist/app /shared/app USER root +ARG BUILD_ALL_CLIS=true +RUN if [ "$BUILD_ALL_CLIS" = "true" ] ; then \ + CPU_ARCH=$(cat /usr/local/bin/argocd-arch) && ln -s /usr/local/bin/argocd-linux-$CPU_ARCH /usr/local/bin/argocd \ + ; fi RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-util RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-application-controller RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-dex -USER 999 \ No newline at end of file +USER 999 diff --git a/server/server.go b/server/server.go index e93b5e697b9cd..4d6fb1f2ab209 100644 --- a/server/server.go +++ b/server/server.go @@ -755,12 +755,20 @@ func newRedirectServer(port int, rootPath string) *http.Server { // registerDownloadHandlers registers HTTP handlers to support downloads directly from the API server // (e.g. argocd CLI) func registerDownloadHandlers(mux *http.ServeMux, base string) { - linuxPath, err := exec.LookPath("argocd") + linuxAmdPath, err := exec.LookPath("argocd-linux-amd64") if err != nil { - log.Warnf("argocd not in PATH") + log.Warnf("argocd-linux-amd64 not in PATH") } else { mux.HandleFunc(base+"/argocd-linux-amd64", func(w http.ResponseWriter, r *http.Request) { - http.ServeFile(w, r, linuxPath) + http.ServeFile(w, r, linuxAmdPath) + }) + } + linuxArmPath, err := exec.LookPath("argocd-linux-arm64") + if err != nil { + log.Warnf("argocd-linux-arm64 not in PATH") + } else { + mux.HandleFunc(base+"/argocd-linux-arm64", func(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, linuxArmPath) }) } darwinPath, err := exec.LookPath("argocd-darwin-amd64")