-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile
43 lines (34 loc) · 1.4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
ARG ARGOCD_VERSION=latest
FROM argoproj/argocd:$ARGOCD_VERSION as argocd
FROM node:11.10.1-slim
RUN apt-get update && \
apt-get --no-install-recommends install -y git apt-utils sudo python make vim procps && \
apt-get clean && \
rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
WORKDIR /home/argocd/argocd-bot
COPY --from=argocd /usr/local/bin/argocd /usr/local/bin/argocd
COPY --from=argocd /usr/local/bin/helm /usr/local/bin/helm
COPY --from=argocd /usr/local/bin/kustomize /usr/local/bin/kustomize
COPY --from=argocd /usr/local/bin/kustomize /usr/local/bin/kustomize1
COPY --from=argocd /usr/local/bin/ks /usr/local/bin/ks
RUN groupadd -g 999 argocd && \
useradd -r -u 999 -g argocd argocd && \
chown argocd:argocd /home/argocd && \
chown argocd:argocd /home/argocd/argocd-bot
# allow argocd user to have sudo access (for quickly debugging things inside the pod)
RUN echo "argocd ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
COPY --chown=argocd . ./
COPY --chown=argocd deployment/diff_helper.sh /usr/local/bin/diff_helper
#workaround https://github.com/golang/go/issues/14625
ENV USER=argocd
USER argocd
# used by argocd cli tool, makes diff prettier for github markdown
ENV KUBECTL_EXTERNAL_DIFF=/usr/local/bin/diff_helper
# run npm as argocd user
RUN npm install && npm run build && npm run test