2023-08-11 16:46:43 +00:00
|
|
|
ARG BASE_IMAGE=docker.io/library/ubuntu:22.04@sha256:0bced47fffa3361afa981854fcabcd4577cd43cebbb808cea2b1f33a3dd7f508
|
2018-08-28 23:00:14 +00:00
|
|
|
####################################################################################################
|
|
|
|
|
# Builder image
|
|
|
|
|
# Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image
|
|
|
|
|
# Also used as the image in CI jobs so needs all dependencies
|
|
|
|
|
####################################################################################################
|
2023-10-11 15:20:40 +00:00
|
|
|
FROM docker.io/library/golang:1.21.3@sha256:02d7116222536a5cf0fcf631f90b507758b669648e0f20186d2dc94a9b419a9b AS builder
|
2018-08-28 23:00:14 +00:00
|
|
|
|
2019-10-08 21:53:51 +00:00
|
|
|
RUN echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list
|
2019-07-18 19:49:49 +00:00
|
|
|
|
2022-04-13 20:03:34 +00:00
|
|
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
2019-07-13 00:17:23 +00:00
|
|
|
openssh-server \
|
|
|
|
|
nginx \
|
2022-04-13 20:03:34 +00:00
|
|
|
unzip \
|
2019-07-13 00:17:23 +00:00
|
|
|
fcgiwrap \
|
2018-08-28 23:00:14 +00:00
|
|
|
git \
|
2019-07-18 19:49:49 +00:00
|
|
|
git-lfs \
|
2018-08-28 23:00:14 +00:00
|
|
|
make \
|
|
|
|
|
wget \
|
|
|
|
|
gcc \
|
2021-04-19 16:46:21 +00:00
|
|
|
sudo \
|
2018-08-28 23:00:14 +00:00
|
|
|
zip && \
|
|
|
|
|
apt-get clean && \
|
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
|
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
|
2022-04-13 20:03:34 +00:00
|
|
|
COPY hack/install.sh hack/tool-versions.sh ./
|
|
|
|
|
COPY hack/installers installers
|
2019-10-18 20:21:36 +00:00
|
|
|
|
2022-04-13 20:03:34 +00:00
|
|
|
RUN ./install.sh helm-linux && \
|
2022-04-15 00:25:08 +00:00
|
|
|
INSTALL_PATH=/usr/local/bin ./install.sh kustomize
|
2018-09-13 07:09:23 +00:00
|
|
|
|
2019-02-01 21:12:52 +00:00
|
|
|
####################################################################################################
|
|
|
|
|
# Argo CD Base - used as the base for both the release and dev argocd images
|
|
|
|
|
####################################################################################################
|
2022-04-13 20:03:34 +00:00
|
|
|
FROM $BASE_IMAGE AS argocd-base
|
2019-02-01 21:12:52 +00:00
|
|
|
|
2023-02-03 15:44:47 +00:00
|
|
|
LABEL org.opencontainers.image.source="https://github.com/argoproj/argo-cd"
|
|
|
|
|
|
2019-06-14 22:50:43 +00:00
|
|
|
USER root
|
|
|
|
|
|
2022-08-05 19:17:35 +00:00
|
|
|
ENV ARGOCD_USER_ID=999
|
2021-01-05 22:16:54 +00:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2019-07-18 19:49:49 +00:00
|
|
|
|
2022-08-05 19:17:35 +00:00
|
|
|
RUN groupadd -g $ARGOCD_USER_ID argocd && \
|
|
|
|
|
useradd -r -u $ARGOCD_USER_ID -g argocd argocd && \
|
2019-02-01 21:12:52 +00:00
|
|
|
mkdir -p /home/argocd && \
|
2019-10-01 19:42:41 +00:00
|
|
|
chown argocd:0 /home/argocd && \
|
|
|
|
|
chmod g=u /home/argocd && \
|
2019-02-01 21:12:52 +00:00
|
|
|
apt-get update && \
|
2021-01-05 22:16:54 +00:00
|
|
|
apt-get dist-upgrade -y && \
|
2022-04-13 20:03:34 +00:00
|
|
|
apt-get install -y \
|
2024-01-09 14:41:12 +00:00
|
|
|
git git-lfs tini gpg tzdata connect-proxy && \
|
2019-02-01 21:12:52 +00:00
|
|
|
apt-get clean && \
|
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
|
2020-06-22 16:21:53 +00:00
|
|
|
COPY hack/gpg-wrapper.sh /usr/local/bin/gpg-wrapper.sh
|
|
|
|
|
COPY hack/git-verify-wrapper.sh /usr/local/bin/git-verify-wrapper.sh
|
2019-02-01 21:12:52 +00:00
|
|
|
COPY --from=builder /usr/local/bin/helm /usr/local/bin/helm
|
|
|
|
|
COPY --from=builder /usr/local/bin/kustomize /usr/local/bin/kustomize
|
2021-08-18 10:18:01 +00:00
|
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
2021-08-23 06:38:29 +00:00
|
|
|
# keep uid_entrypoint.sh for backward compatibility
|
2022-04-15 00:25:08 +00:00
|
|
|
RUN ln -s /usr/local/bin/entrypoint.sh /usr/local/bin/uid_entrypoint.sh
|
2019-02-01 21:12:52 +00:00
|
|
|
|
2019-07-11 23:00:47 +00:00
|
|
|
# support for mounting configuration from a configmap
|
2022-04-13 20:03:34 +00:00
|
|
|
WORKDIR /app/config/ssh
|
|
|
|
|
RUN touch ssh_known_hosts && \
|
2022-06-21 13:46:41 +00:00
|
|
|
ln -s /app/config/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts
|
2019-07-11 23:00:47 +00:00
|
|
|
|
2022-04-13 20:03:34 +00:00
|
|
|
WORKDIR /app/config
|
|
|
|
|
RUN mkdir -p tls && \
|
|
|
|
|
mkdir -p gpg/source && \
|
|
|
|
|
mkdir -p gpg/keys && \
|
|
|
|
|
chown argocd gpg/keys && \
|
|
|
|
|
chmod 0700 gpg/keys
|
2019-07-11 23:00:47 +00:00
|
|
|
|
2019-02-01 21:12:52 +00:00
|
|
|
ENV USER=argocd
|
|
|
|
|
|
2022-08-05 19:17:35 +00:00
|
|
|
USER $ARGOCD_USER_ID
|
2019-02-01 21:12:52 +00:00
|
|
|
WORKDIR /home/argocd
|
|
|
|
|
|
2019-07-30 20:07:20 +00:00
|
|
|
####################################################################################################
|
|
|
|
|
# Argo CD UI stage
|
|
|
|
|
####################################################################################################
|
2024-02-20 11:23:01 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM docker.io/library/node:21.6.2@sha256:65998e325b06014d4f1417a8a6afb1540d1ac66521cca76f2221a6953947f9ee AS argocd-ui
|
2019-07-30 20:07:20 +00:00
|
|
|
|
|
|
|
|
WORKDIR /src
|
2022-04-13 20:03:34 +00:00
|
|
|
COPY ["ui/package.json", "ui/yarn.lock", "./"]
|
2019-07-30 20:07:20 +00:00
|
|
|
|
2022-04-13 20:03:34 +00:00
|
|
|
RUN yarn install --network-timeout 200000 && \
|
|
|
|
|
yarn cache clean
|
2019-07-30 20:07:20 +00:00
|
|
|
|
2022-04-13 20:03:34 +00:00
|
|
|
COPY ["ui/", "."]
|
2019-07-30 20:07:20 +00:00
|
|
|
|
|
|
|
|
ARG ARGO_VERSION=latest
|
|
|
|
|
ENV ARGO_VERSION=$ARGO_VERSION
|
2022-07-25 16:26:44 +00:00
|
|
|
ARG TARGETARCH
|
|
|
|
|
RUN HOST_ARCH=$TARGETARCH NODE_ENV='production' NODE_ONLINE_ENV='online' NODE_OPTIONS=--max_old_space_size=8192 yarn build
|
2019-02-01 21:12:52 +00:00
|
|
|
|
2018-08-28 23:00:14 +00:00
|
|
|
####################################################################################################
|
2018-11-05 19:29:01 +00:00
|
|
|
# Argo CD Build stage which performs the actual build of Argo CD binaries
|
2018-08-28 23:00:14 +00:00
|
|
|
####################################################################################################
|
2023-10-11 15:20:40 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21.3@sha256:02d7116222536a5cf0fcf631f90b507758b669648e0f20186d2dc94a9b419a9b AS argocd-build
|
2018-08-28 23:00:14 +00:00
|
|
|
|
2020-05-26 19:42:58 +00:00
|
|
|
WORKDIR /go/src/github.com/argoproj/argo-cd
|
|
|
|
|
|
2022-04-13 20:03:34 +00:00
|
|
|
COPY go.* ./
|
2020-05-26 19:42:58 +00:00
|
|
|
RUN go mod download
|
2018-08-28 23:00:14 +00:00
|
|
|
|
|
|
|
|
# Perform the build
|
|
|
|
|
COPY . .
|
2021-07-22 23:02:58 +00:00
|
|
|
COPY --from=argocd-ui /src/dist/app /go/src/github.com/argoproj/argo-cd/ui/dist/app
|
2022-03-23 21:09:08 +00:00
|
|
|
ARG TARGETOS
|
|
|
|
|
ARG TARGETARCH
|
2023-06-20 19:19:09 +00:00
|
|
|
# These build args are optional; if not specified the defaults will be taken from the Makefile
|
|
|
|
|
ARG GIT_TAG
|
|
|
|
|
ARG BUILD_DATE
|
|
|
|
|
ARG GIT_TREE_STATE
|
|
|
|
|
ARG GIT_COMMIT
|
|
|
|
|
RUN GIT_COMMIT=$GIT_COMMIT \
|
|
|
|
|
GIT_TREE_STATE=$GIT_TREE_STATE \
|
|
|
|
|
GIT_TAG=$GIT_TAG \
|
|
|
|
|
BUILD_DATE=$BUILD_DATE \
|
|
|
|
|
GOOS=$TARGETOS \
|
|
|
|
|
GOARCH=$TARGETARCH \
|
|
|
|
|
make argocd-all
|
2018-08-28 23:00:14 +00:00
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
# Final image
|
|
|
|
|
####################################################################################################
|
2019-02-01 21:12:52 +00:00
|
|
|
FROM argocd-base
|
|
|
|
|
COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/
|
2021-01-20 19:28:06 +00:00
|
|
|
|
|
|
|
|
USER root
|
2022-04-13 20:03:34 +00:00
|
|
|
RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \
|
|
|
|
|
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \
|
|
|
|
|
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \
|
|
|
|
|
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-application-controller && \
|
|
|
|
|
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-dex && \
|
|
|
|
|
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-notifications && \
|
2022-04-15 00:25:08 +00:00
|
|
|
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-applicationset-controller && \
|
|
|
|
|
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-k8s-auth
|
2021-01-20 19:28:06 +00:00
|
|
|
|
2022-08-05 19:17:35 +00:00
|
|
|
USER $ARGOCD_USER_ID
|
2023-03-10 17:31:20 +00:00
|
|
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|