github.com/argoproj/argo-cd@v1.8.7/test/container/Dockerfile (about) 1 FROM redis:5.0.10 as redis 2 3 FROM node:12.18.4 as node 4 5 FROM golang:1.14.12 as golang 6 7 FROM debian:10-slim 8 9 RUN echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list && \ 10 apt-get update && apt-get install -y \ 11 ca-certificates \ 12 curl \ 13 openssh-server \ 14 nginx \ 15 fcgiwrap \ 16 git \ 17 git-lfs \ 18 gpg \ 19 make \ 20 wget \ 21 gcc \ 22 sudo \ 23 zip && \ 24 apt-get clean && \ 25 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 26 27 COPY --from=golang /usr/local/go /usr/local/go 28 29 ENV PATH /go/bin:/usr/local/go/bin:$PATH 30 ENV GOROOT /usr/local/go 31 ENV GOPATH /go 32 33 # Install build and test dependencies 34 ADD ./hack/tool-versions.sh . 35 ADD ./hack/install.sh . 36 ADD ./hack/installers installers 37 38 RUN ./install.sh dep-linux && \ 39 ./install.sh packr-linux && \ 40 ./install.sh kubectl-linux && \ 41 ./install.sh ksonnet-linux && \ 42 ./install.sh helm2-linux && \ 43 ./install.sh helm-linux && \ 44 ./install.sh kustomize-linux && \ 45 ./install.sh codegen-tools && \ 46 ./install.sh codegen-go-tools && \ 47 ./install.sh lint-tools && \ 48 go get github.com/mattn/goreman && \ 49 go get github.com/kisielk/godepgraph && \ 50 go get github.com/jstemmer/go-junit-report && \ 51 rm -rf /tmp/dl && \ 52 rm -rf /tmp/helm && \ 53 rm -rf /tmp/helm2 && \ 54 rm -rf /tmp/ks_* && \ 55 rm -rf /tmp/packr 56 57 # These are required for running end-to-end tests 58 COPY ./test/fixture/testrepos/id_rsa.pub /root/.ssh/authorized_keys 59 COPY ./test/fixture/testrepos/nginx.conf /etc/nginx/nginx.conf 60 COPY ./test/fixture/testrepos/sudoers.conf /etc/sudoers 61 COPY ./test/fixture/testrepos/ssh_host_*_key* /etc/ssh/ 62 63 # Copy redis binaries to the image 64 COPY --from=redis /usr/local/bin/* /usr/local/bin/ 65 66 # Copy node binaries 67 COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules 68 COPY --from=node /usr/local/bin/node /usr/local/bin 69 COPY --from=node /opt/yarn-v1.22.4 /opt/yarn-v1.22.4 70 71 # Entrypoint is required for container's user management 72 COPY ./test/container/uid_entrypoint.sh /usr/local/bin 73 74 ARG UID 75 76 # Prepare user configuration & build environments 77 RUN useradd -l -u ${UID} -d /home/user -s /bin/bash user && \ 78 echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user && \ 79 HELM_HOME=/home/user/.helm helm2 init --client-only && \ 80 HOME=/home/user git config --global user.name "ArgoCD Test User" && \ 81 HOME=/home/user git config --global user.email "noreply@example.com" && \ 82 mkdir -p /go/pkg && chmod 777 /go/pkg && \ 83 mkdir -p /home/user/.kube && chmod 777 /home/user/.kube && \ 84 mkdir -p /var/run/sshd && \ 85 mkdir -p /root/.ssh && \ 86 mkdir -p /go && \ 87 chmod -R 777 /go && \ 88 chown root /etc/ssh/ssh_host_*_key* && \ 89 chmod 0600 /etc/ssh/ssh_host_*_key && \ 90 mkdir -p /tmp/go-build-cache && chmod -R 777 /tmp/go-build-cache && \ 91 mkdir -p /home/user/.cache && chmod 777 /home/user/.cache && \ 92 chown -R user /home/user && \ 93 chgrp -R user /home/user && \ 94 chmod -R 777 /usr/local/go && \ 95 ln -s /usr/local/bin/node /usr/local/bin/nodejs && \ 96 ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ 97 ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \ 98 ln -s /opt/yarn-v1.22.4/bin/yarn /usr/local/bin/yarn && \ 99 ln -s /opt/yarn-v1.22.4/bin/yarnpkg /usr/local/bin/yarnpkg 100 101 ENTRYPOINT ["/usr/local/bin/uid_entrypoint.sh"]