github.com/argoproj/argo-cd/v3@v3.2.1/test/container/Dockerfile (about) 1 FROM docker.io/library/redis:8.2.1@sha256:cc2dfb8f5151da2684b4a09bd04b567f92d07591d91980eb3eca21df07e12760 AS redis 2 3 # There are libraries we will want to copy from here in the final stage of the 4 # build, but the COPY directive does not have a way to determine system 5 # architecture, so we create a symlink here to facilitate copying. 6 RUN ln -s /usr/lib/$(uname -m)-linux-gnu /usr/lib/linux-gnu 7 8 # Please make sure to also check the contained yarn version and update the references below when upgrading this image's version 9 FROM docker.io/library/node:22.9.0@sha256:69e667a79aa41ec0db50bc452a60e705ca16f35285eaf037ebe627a65a5cdf52 AS node 10 11 FROM docker.io/library/golang:1.25.0@sha256:9e56f0d0f043a68bb8c47c819e47dc29f6e8f5129b8885bed9d43f058f7f3ed6 AS golang 12 13 FROM docker.io/library/registry:3.0@sha256:3725021071ec9383eb3d87ddbdff9ed602439b3f7c958c9c2fb941049ea6531d AS registry 14 15 FROM docker.io/bitnamilegacy/kubectl:1.32@sha256:493d1b871556d48d6b25d471f192c2427571cd6f78523eebcaf4d263353c7487 AS kubectl 16 17 FROM docker.io/library/ubuntu:25.10@sha256:a61c057b4f69200ecf031519a20db79b8683837ba1dc2a59458d333eb75b174d 18 19 ENV DEBIAN_FRONTEND=noninteractive 20 21 # NOTE: binutils-gold contains the gold linker, which was recently removed 22 # from binutils, but is still nesessary for building lint-tools on arm64 only 23 # until this Golang issue is fixed: https://github.com/golang/go/issues/22040 24 RUN apt-get update && apt-get install --fix-missing -y \ 25 ca-certificates \ 26 curl \ 27 openssh-server \ 28 nginx \ 29 fcgiwrap \ 30 git \ 31 git-lfs \ 32 gpg \ 33 jq \ 34 make \ 35 wget \ 36 gcc \ 37 g++ \ 38 sudo \ 39 tini \ 40 zip && \ 41 if [ "$(uname -m)" = "aarch64" ]; then \ 42 apt-get install --fix-missing -y binutils-gold; \ 43 fi && \ 44 apt-get clean && \ 45 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 46 47 COPY --from=golang /usr/local/go /usr/local/go 48 49 COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/kubectl 50 51 ENV PATH=/dist:/go/bin:/usr/local/go/bin:/go/src/github.com/argoproj/argo-cd/dist:$PATH 52 ENV GOROOT=/usr/local/go 53 ENV GOPATH=/go 54 55 # Install build and test dependencies 56 COPY hack/install.sh hack/tool-versions.sh go.* ./ 57 COPY hack/installers installers 58 59 RUN ./install.sh helm && \ 60 ./install.sh kustomize && \ 61 ./install.sh codegen-tools && \ 62 ./install.sh codegen-go-tools && \ 63 ./install.sh lint-tools && \ 64 ./install.sh gotestsum && \ 65 go install github.com/mattn/goreman@latest && \ 66 go install github.com/kisielk/godepgraph@latest && \ 67 go install github.com/jstemmer/go-junit-report@latest && \ 68 rm -rf /tmp/dl && \ 69 rm -rf /tmp/helm && \ 70 rm -rf /tmp/ks_* 71 72 # These are required for running end-to-end tests 73 COPY ./test/fixture/testrepos/id_rsa.pub /root/.ssh/authorized_keys 74 COPY ./test/fixture/testrepos/nginx.conf /etc/nginx/nginx.conf 75 COPY ./test/fixture/testrepos/sudoers.conf /etc/sudoers 76 COPY ./test/fixture/testrepos/ssh_host_*_key* /etc/ssh/ 77 78 # Copy redis binaries to the image 79 COPY --from=redis /usr/local/bin/* /usr/local/bin/ 80 81 # Copy redis dependencies/shared libraries 82 # Ubuntu 22.04+ has moved to OpenSSL3 and no longer provides these libraries 83 COPY --from=redis /usr/lib/linux-gnu/libssl.so.3 /usr/lib/linux-gnu/ 84 COPY --from=redis /usr/lib/linux-gnu/libcrypto.so.3 /usr/lib/linux-gnu/ 85 RUN mv /usr/lib/linux-gnu/libssl.so.3 /usr/lib/$(uname -m)-linux-gnu/ && \ 86 mv /usr/lib/linux-gnu/libcrypto.so.3 /usr/lib/$(uname -m)-linux-gnu/ && \ 87 rm -rf /usr/lib/linux-gnu/ 88 89 # Copy registry binaries to the image 90 COPY --from=registry /bin/registry /usr/local/bin/ 91 COPY --from=registry /etc/distribution/config.yml /etc/docker/registry/config.yml 92 93 # Copy node binaries 94 COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules 95 COPY --from=node /usr/local/bin/node /usr/local/bin 96 COPY --from=node /opt/yarn-v1.22.22 /opt/yarn-v1.22.22 97 98 # Entrypoint is required for container's user management 99 COPY ./test/container/entrypoint.sh /usr/local/bin 100 101 ARG UID 102 103 # Prepare user configuration & build environments 104 RUN userdel -r ubuntu && \ 105 useradd -l -u ${UID} -d /home/user -s /bin/bash user && \ 106 echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user && \ 107 mkdir -p /home/user/.kube && \ 108 mkdir -p /home/user/.cache && \ 109 chown -R user /home/user && \ 110 chgrp -R user /home/user && \ 111 mkdir -p /go/src/github.com/gogo && \ 112 mkdir -p /go/src/k8s.io && \ 113 chown -R user /go && \ 114 HOME=/home/user git config --global user.name "ArgoCD Test User" && \ 115 HOME=/home/user git config --global user.email "noreply@example.com" && \ 116 HOME=/home/user git config --global --add safe.directory '*' && \ 117 mkdir -p /go/src && \ 118 mkdir -p /go/pkg && \ 119 chown -R user:user /go && \ 120 mkdir -p /var/run/sshd && \ 121 mkdir -p /root/.ssh && \ 122 chown root /etc/ssh/ssh_host_*_key* && \ 123 chmod 0600 /etc/ssh/ssh_host_*_key && \ 124 mkdir -p /tmp/go-build-cache && \ 125 chown -R user:user /tmp/go-build-cache && \ 126 ln -s /usr/local/bin/node /usr/local/bin/nodejs && \ 127 ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ 128 ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \ 129 ln -s /opt/yarn-v1.22.22/bin/yarn /usr/local/bin/yarn && \ 130 ln -s /opt/yarn-v1.22.22/bin/yarnpkg /usr/local/bin/yarnpkg && \ 131 mkdir -p /var/lib/registry 132 133 ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]