argo-cd
argo-cd copied to clipboard
Expose the Argo CD User ID in the Dockerfile
Summary
Set the Argo CD user ID as an Arg
Motivation
Clients that need to amend the argocd image sometimes need to change users to install things. Ie,
- Adding a custom CA
- Adding a different version of templating tools (outside of the plugin framework)
It would be nice to not have to hardcode the 999
.
Proposal
Make the ID an ENV in the Dockerfile just like the USER
ARG KUSTOMIZE_VERSION=v4.5.2
ARG ARGOCD_VERSION=v2.3.4
FROM us.gcr.io/k8s-artifacts-prod/kustomize/kustomize:$KUSTOMIZE_VERSION as kustomize
FROM busybox as cacerts
# Grab certs
....
FROM quay.io/argoproj/argocd:$ARGOCD_VERSION
# Grab the version of kustomize we want
COPY --from=kustomize /app/kustomize /usr/local/bin
RUN kustomize version
# Become the root user for installing the certs
USER root
COPY --from=cacerts /tmp/corpcert.cer /usr/local/share/ca-certificates/internal-ca-bundle.crt
RUN update-ca-certificates
# Fallback to the argo user
USER 999 # <-- $ARGO_USER_ID