github.com/argoproj/argo-cd/v2@v2.10.5/test/remote/Dockerfile (about)

     1  ARG BASE_IMAGE=docker.io/library/ubuntu:22.04
     2  
     3  FROM docker.io/library/golang:1.21.3@sha256:02d7116222536a5cf0fcf631f90b507758b669648e0f20186d2dc94a9b419a9b AS go
     4  
     5  RUN go install github.com/mattn/goreman@latest && \
     6      go install github.com/kisielk/godepgraph@latest
     7  
     8  FROM $BASE_IMAGE
     9  
    10  ENV DEBIAN_FRONTEND=noninteractive
    11  RUN  apt-get update && apt-get install --no-install-recommends -y \
    12      ca-certificates \
    13      curl \
    14      openssh-server \
    15      nginx \
    16      fcgiwrap \
    17      git \
    18      git-lfs \
    19      gpg \
    20      make \
    21      wget \
    22      gcc \
    23      sudo \
    24      zip && \
    25      apt-get clean && \
    26      rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
    27  
    28  # These are required for running end-to-end tests
    29  COPY ./test/fixture/testrepos/id_rsa.pub /root/.ssh/authorized_keys
    30  COPY ./test/fixture/testrepos/nginx.conf /etc/nginx/nginx.conf
    31  COPY ./test/fixture/testrepos/.htpasswd /etc/nginx/.htpasswd
    32  COPY ./test/fixture/testrepos/sudoers.conf /etc/sudoers
    33  COPY ./test/fixture/testrepos/ssh_host_*_key* /etc/ssh/
    34  COPY ./test/fixture/certs/argocd-e2e-server.crt /etc/certs/argocd-test-server.crt
    35  COPY ./test/fixture/certs/argocd-e2e-server.key /etc/certs/argocd-test-server.key
    36  COPY ./test/fixture/certs/argocd-test-ca.crt /etc/certs/argocd-test-ca.crt
    37  
    38  # Entrypoint is required for container's user management
    39  COPY ./test/remote/entrypoint.sh /usr/local/bin
    40  COPY ./test/remote/Procfile /Procfile
    41  
    42  # We need goreman
    43  COPY --from=go /go/bin/goreman /usr/local/bin/goreman
    44  
    45  COPY ./test/e2e/testdata/ /app/config/testdata/
    46  
    47  # Prepare user configuration & build environments
    48  RUN useradd -l -u 1000 -d /home/user -s /bin/bash user && \
    49      echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/user && \
    50      mkdir -p /home/user && \
    51      HOME=/home/user git config --global user.name "ArgoCD Test User" && \
    52      HOME=/home/user git config --global user.email "noreply@example.com" && \
    53      mkdir -p /var/run/sshd && \
    54      mkdir -p /root/.ssh && \
    55      chown -R user /home/user && \
    56      chgrp -R user /home/user && \
    57      chown root /etc/ssh/ssh_host_*_key* && \
    58      chmod 0600 /etc/ssh/ssh_host_*_key  && \
    59      mkdir -p /tmp/argo-e2e/testdata.git && \
    60      cd /tmp/argo-e2e/testdata.git && \
    61      HOME=/home/user git init --bare && \
    62      cd /app/config/testdata && \
    63      HOME=/home/user git init && \
    64      HOME=/home/user git add . && \
    65      HOME=/home/user git commit -a -m "Initial commit" && \
    66      HOME=/home/user git remote add origin file:///tmp/argo-e2e/testdata.git && \
    67      HOME=/home/user git push origin master && \
    68      mkdir -p /tmp/argo-e2e/submodule.git && \
    69      cd /tmp/argo-e2e/submodule.git && \
    70      HOME=/home/user git init --bare && \
    71      mkdir -p /tmp/argo-e2e/submoduleParent.git && \
    72      cd /tmp/argo-e2e/submoduleParent.git && \
    73      HOME=/home/user git init --bare && \
    74      chown -R user /tmp/argo-e2e/testdata.git && \
    75      chown -R user /tmp/argo-e2e/submodule.git && \
    76      chown -R user /tmp/argo-e2e/submoduleParent.git && \
    77      ln -s /usr/libexec/git-core /usr/lib/git-core
    78  
    79  RUN echo "[http]" >> /tmp/argo-e2e/testdata.git/config && \
    80      echo "  receivepack = true" >> /tmp/argo-e2e/testdata.git/config 
    81  RUN echo "[http]" >> /tmp/argo-e2e/submodule.git/config && \
    82      echo "  receivepack = true" >> /tmp/argo-e2e/submodule.git/config 
    83  RUN echo "[http]" >> /tmp/argo-e2e/submoduleParent.git/config && \
    84      echo "  receivepack = true" >> /tmp/argo-e2e/submoduleParent.git/config 
    85  
    86  ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]