• Fred Dubois's avatar
    Make argo-cd docker images openshift friendly (#2362) · 01ce567b
    Fred Dubois authored
    In openshift clusters, the user id of your container can be arbitrary,
    so you need to make the running images compatible with this behavior.
    
    The problematic application for argo-cd was the repo server. When trying
    to clone the repos it was getting the error "No user exists for uid
    100083000" (100083000 was the random user id being injected by
    openshift in my case). This was because the user 100083000 wasn't in the
    /etc/passwd file.
    
    The changes in this commit add a uid_entrypoint.sh script that, when the
    container starts, modifies the /etc/passwd file to add an entry with the
    current UID _only_ if the current UID isn't there.
    
    References:
    * Problematic behavior of ssh when user id isn't in the /etc/passwd file:
      https://unix.stackexchange.com/questions/524268/running-git-or-ssh-client-in-docker-as-user-no-user-exists-for-uid
    * OpenShift guidelines on how to make your docker image runnable by
      arbitrary user ids:
      https://access.re...
    01ce567b