2024-12-06 13:17:15 +00:00
|
|
|
FROM quay.io/argoproj/argocd:v2.13.1
|
2024-05-17 12:09:46 +00:00
|
|
|
|
2024-12-06 13:01:05 +00:00
|
|
|
# renovate: datasource=github-releases depName=sops packageName=getsops/sops
|
2024-12-06 13:17:15 +00:00
|
|
|
ARG SOPS_VERSION=v3.9.2
|
2024-12-06 13:01:05 +00:00
|
|
|
# renovate: datasource=github-releases depName=vals packageName=helmfile/vals
|
2024-12-06 13:17:15 +00:00
|
|
|
ARG VALS_VERSION=v0.38.0
|
2024-12-06 13:01:05 +00:00
|
|
|
# renovate: datasource=github-releases depName=helm-secrets packageName=jkroepke/helm-secrets
|
2024-12-06 13:15:32 +00:00
|
|
|
ARG HELM_SECRETS_VERSION=v4.6.2
|
2024-12-06 13:01:05 +00:00
|
|
|
|
2024-05-17 12:09:46 +00:00
|
|
|
ARG ARGOCD_USER_ID="999"
|
2024-12-06 13:01:05 +00:00
|
|
|
|
|
|
|
# set Vals
|
2024-05-17 11:03:48 +00:00
|
|
|
ENV HELM_SECRETS_BACKEND="vals" \
|
|
|
|
HELM_SECRETS_HELM_PATH=/usr/local/bin/helm \
|
|
|
|
HELM_PLUGINS="/home/argocd/.local/share/helm/plugins/" \
|
|
|
|
HELM_SECRETS_VALUES_ALLOW_SYMLINKS=false \
|
2024-05-18 20:14:04 +00:00
|
|
|
HELM_SECRETS_VALUES_ALLOW_ABSOLUTE_PATH=true \
|
2024-05-17 11:03:48 +00:00
|
|
|
HELM_SECRETS_VALUES_ALLOW_PATH_TRAVERSAL=false \
|
2024-05-18 13:15:34 +00:00
|
|
|
HELM_SECRETS_WRAPPER_ENABLED=true
|
2024-05-17 11:03:48 +00:00
|
|
|
|
|
|
|
# Optionally, set default gpg key for sops files
|
|
|
|
# ENV HELM_SECRETS_LOAD_GPG_KEYS=/path/to/gpg.key
|
|
|
|
|
|
|
|
USER root
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
|
|
|
curl && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
2024-11-13 12:48:29 +00:00
|
|
|
# sops (use via vals!)
|
2024-12-06 13:15:32 +00:00
|
|
|
RUN curl -fsSL https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64 \
|
2024-11-13 12:48:29 +00:00
|
|
|
-o /usr/local/bin/sops && chmod +x /usr/local/bin/sops
|
2024-05-17 11:03:48 +00:00
|
|
|
|
2024-11-13 12:48:29 +00:00
|
|
|
# vals backend installation
|
2024-12-06 13:15:32 +00:00
|
|
|
RUN curl -fsSL https://github.com/helmfile/vals/releases/download/${VALS_VERSION}/vals_${VALS_VERSION#v}_linux_amd64.tar.gz \
|
2024-05-17 11:03:48 +00:00
|
|
|
| tar xzf - -C /usr/local/bin/ vals \
|
|
|
|
&& chmod +x /usr/local/bin/vals
|
|
|
|
|
|
|
|
RUN ln -sf "$(helm env HELM_PLUGINS)/helm-secrets/scripts/wrapper/helm.sh" /usr/local/sbin/helm
|
|
|
|
|
2024-05-19 16:42:03 +00:00
|
|
|
# Add init script to convert SA token into kubeconfig for vals
|
|
|
|
ADD sa2kubeconfig.sh /usr/local/bin/sa2kubeconfig.sh
|
|
|
|
|
2024-05-17 12:09:46 +00:00
|
|
|
USER ${ARGOCD_USER_ID}
|
2024-05-17 11:03:48 +00:00
|
|
|
|
2024-12-06 13:15:32 +00:00
|
|
|
RUN helm plugin install --version ${HELM_SECRETS_VERSION#v} https://github.com/jkroepke/helm-secrets
|
2024-05-20 10:47:15 +00:00
|
|
|
RUN mkdir -p /home/argocd/.kube && sed -i -e 's/secrets/secrets --evaluate-templates/' "$(helm env HELM_PLUGINS)/helm-secrets/scripts/wrapper/helm.sh"
|