github.com/argoproj/argo-cd/v2@v2.10.5/test/container/Dockerfile (about) 1 FROM docker.io/library/redis:7.0.11@sha256:f50031a49f41e493087fb95f96fdb3523bb25dcf6a3f0b07c588ad3cdbe1d0aa 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:20.7.0@sha256:f08c20b9f9c55dd47b1841793f0ee480c5395aa165cd02edfd68b068ed64bfb5 as node 10 11 FROM docker.io/library/golang:1.21.3@sha256:02d7116222536a5cf0fcf631f90b507758b669648e0f20186d2dc94a9b419a9b as golang 12 13 FROM docker.io/library/registry:2.8@sha256:41f413c22d6156587e2a51f3e80c09808b8c70e82be149b82b5e0196a88d49b4 as registry 14 15 FROM docker.io/bitnami/kubectl:1.27@sha256:670fe3f50d45c0511bb0f2af018e2fc082ac8cdfaea02dba4e32866296036926 as kubectl 16 17 FROM docker.io/library/ubuntu:22.04@sha256:0bced47fffa3361afa981854fcabcd4577cd43cebbb808cea2b1f33a3dd7f508 18 19 ENV DEBIAN_FRONTEND=noninteractive 20 RUN apt-get update && apt-get install --fix-missing -y \ 21 ca-certificates \ 22 curl \ 23 openssh-server \ 24 nginx \ 25 fcgiwrap \ 26 git \ 27 git-lfs \ 28 gpg \ 29 jq \ 30 make \ 31 wget \ 32 gcc \ 33 g++ \ 34 sudo \ 35 tini \ 36 zip && \ 37 apt-get clean && \ 38 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 39 40 COPY --from=golang /usr/local/go /usr/local/go 41 42 COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/kubectl 43 44 ENV PATH /dist:/go/bin:/usr/local/go/bin:/go/src/github.com/argoproj/argo-cd/dist:$PATH 45 ENV GOROOT /usr/local/go 46 ENV GOPATH /go 47 48 # Install build and test dependencies 49 COPY hack/install.sh hack/tool-versions.sh go.* ./ 50 COPY hack/installers installers 51 52 RUN ./install.sh helm-linux && \ 53 ./install.sh kustomize && \ 54 ./install.sh codegen-tools && \ 55 ./install.sh codegen-go-tools && \ 56 ./install.sh lint-tools && \ 57 go install github.com/mattn/goreman@latest && \ 58 go install github.com/kisielk/godepgraph@latest && \ 59 go install github.com/jstemmer/go-junit-report@latest && \ 60 rm -rf /tmp/dl && \ 61 rm -rf /tmp/helm && \ 62 rm -rf /tmp/ks_* 63 64 # These are required for running end-to-end tests 65 COPY ./test/fixture/testrepos/id_rsa.pub /root/.ssh/authorized_keys 66 COPY ./test/fixture/testrepos/nginx.conf /etc/nginx/nginx.conf 67 COPY ./test/fixture/testrepos/sudoers.conf /etc/sudoers 68 COPY ./test/fixture/testrepos/ssh_host_*_key* /etc/ssh/ 69 70 # Copy redis binaries to the image 71 COPY --from=redis /usr/local/bin/* /usr/local/bin/ 72 73 # Copy redis dependencies/shared libraries 74 # Ubuntu 22.04+ has moved to OpenSSL3 and no longer provides these libraries 75 COPY --from=redis /usr/lib/linux-gnu/libssl.so.1.1 /usr/lib/linux-gnu/ 76 COPY --from=redis /usr/lib/linux-gnu/libcrypto.so.1.1 /usr/lib/linux-gnu/ 77 RUN mv /usr/lib/linux-gnu/libssl.so.1.1 /usr/lib/$(uname -m)-linux-gnu/ && \ 78 mv /usr/lib/linux-gnu/libcrypto.so.1.1 /usr/lib/$(uname -m)-linux-gnu/ && \ 79 rm -rf /usr/lib/linux-gnu/ 80 81 # Copy registry binaries to the image 82 COPY --from=registry /bin/registry /usr/local/bin/ 83 COPY --from=registry /etc/docker/registry/config.yml /etc/docker/registry/config.yml 84 85 # Copy node binaries 86 COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules 87 COPY --from=node /usr/local/bin/node /usr/local/bin 88 COPY --from=node /opt/yarn-v1.22.19 /opt/yarn-v1.22.19 89 90 # Entrypoint is required for container's user management 91 COPY ./test/container/entrypoint.sh /usr/local/bin 92 93 ARG UID 94 95 # Prepare user configuration & build environments 96 RUN useradd -l -u ${UID} -d /home/user -s /bin/bash user && \ 97 echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user && \ 98 mkdir -p /home/user/.kube && \ 99 mkdir -p /home/user/.cache && \ 100 chown -R user /home/user && \ 101 chgrp -R user /home/user && \ 102 HOME=/home/user git config --global user.name "ArgoCD Test User" && \ 103 HOME=/home/user git config --global user.email "noreply@example.com" && \ 104 mkdir -p /go/pkg && \ 105 mkdir -p /var/run/sshd && \ 106 mkdir -p /root/.ssh && \ 107 mkdir -p /go && \ 108 chown root /etc/ssh/ssh_host_*_key* && \ 109 chmod 0600 /etc/ssh/ssh_host_*_key && \ 110 mkdir -p /tmp/go-build-cache && \ 111 ln -s /usr/local/bin/node /usr/local/bin/nodejs && \ 112 ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ 113 ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \ 114 ln -s /opt/yarn-v1.22.19/bin/yarn /usr/local/bin/yarn && \ 115 ln -s /opt/yarn-v1.22.19/bin/yarnpkg /usr/local/bin/yarnpkg && \ 116 mkdir -p /var/lib/registry 117 118 ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]