Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

####################################################################################################
Expand All @@ -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
USER 999
14 changes: 11 additions & 3 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down