-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile-ubuntu
89 lines (76 loc) · 5.41 KB
/
Dockerfile-ubuntu
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Copyright 2022 Harness Inc. All rights reserved.
# Use of this source code is governed by the PolyForm Free Trial 1.0.0 license
# that can be found in the licenses directory at the root of this repository, also available at
# https://polyformproject.org/wp-content/uploads/2020/05/PolyForm-Free-Trial-1.0.0.txt.
FROM ubuntu:20.04
LABEL name="harness/delegate" \
vendor="Harness" \
maintainer="Harness"
RUN apt-get update \
&& apt-get install -y \
procps \
hostname \
lsof \
findutils \
tar \
gzip \
git \
locales \
curl \
&& useradd -u 1001 -g 0 harness \
&& apt-get clean all \
&& locale-gen en_US.UTF-8 \
&& mkdir -p /opt/harness-delegate/
COPY immutable-scripts /opt/harness-delegate/
WORKDIR /opt/harness-delegate
COPY --from=eclipse-temurin:17.0.11_9-jre /opt/java/openjdk/ /opt/java/openjdk/
ENV LANG=en_US.UTF-8
ENV HOME=/opt/harness-delegate
ENV CLIENT_TOOLS_DOWNLOAD_DISABLED=true
ENV INSTALL_CLIENT_TOOLS_IN_BACKGROUND=true
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH="$JAVA_HOME/bin:${PATH}"
ARG TARGETARCH
ARG BASEURL=https://app.harness.io/public/shared/delegates
ARG DELEGATEVERSION
RUN set -o pipefail \
&& mkdir -m 777 -p client-tools/kubectl/v1.28.7 \
&& curl -f -s -L -o client-tools/kubectl/v1.28.7/kubectl https://app.harness.io/public/shared/tools/kubectl/release/v1.28.7/bin/linux/$TARGETARCH/kubectl || { echo "Failed to download kubectl"; exit 1; } \
&& mkdir -m 777 -p client-tools/helm/v3.13.3 \
&& curl -f -s -L -o client-tools/helm/v3.13.3/helm https://app.harness.io/public/shared/tools/helm/release/v3.13.3/bin/linux/$TARGETARCH/helm || { echo "Failed to download helm"; exit 1; } \
&& mkdir -m 777 -p client-tools/harness-helm-post-renderer/v0.1.3 \
&& curl -f -s -L -o client-tools/harness-helm-post-renderer/v0.1.3/harness-helm-post-renderer https://app.harness.io/public/shared/tools/harness-helm-post-renderer/release/v0.1.3/bin/linux/$TARGETARCH/harness-helm-post-renderer || { echo "Failed to download harness-helm-post-renderer"; exit 1; } \
&& mkdir -m 777 -p client-tools/go-template/v0.4.5 \
&& curl -f -s -L -o client-tools/go-template/v0.4.5/go-template https://app.harness.io/public/shared/tools/go-template/release/v0.4.5/bin/linux/$TARGETARCH/go-template || { echo "Failed to download go-template"; exit 1; } \
&& mkdir -m 777 -p client-tools/harness-pywinrm/v0.4-dev \
&& curl -f -s -L -o client-tools/harness-pywinrm/v0.4-dev/harness-pywinrm https://app.harness.io/public/shared/tools/harness-pywinrm/release/v0.4-dev/bin/linux/$TARGETARCH/harness-pywinrm || { echo "Failed to download harness-pywinrm"; exit 1; } \
&& mkdir -m 777 -p client-tools/chartmuseum/v0.15.0 \
&& curl -f -s -L -o client-tools/chartmuseum/v0.15.0/chartmuseum https://app.harness.io/public/shared/tools/chartmuseum/release/v0.15.0/bin/linux/$TARGETARCH/chartmuseum || { echo "Failed to download chartmuseum"; exit 1; } \
&& mkdir -m 777 -p client-tools/tf-config-inspect/v1.2 \
&& curl -f -s -L -o client-tools/tf-config-inspect/v1.2/terraform-config-inspect https://app.harness.io/public/shared/tools/terraform-config-inspect/v1.2/linux/$TARGETARCH/terraform-config-inspect || { echo "Failed to download terraform-config-inspect"; exit 1; } \
&& mkdir -m 777 -p client-tools/oc/v4.15.25 \
&& curl -f -s -L -o client-tools/oc/v4.15.25/oc https://app.harness.io/public/shared/tools/oc/release/v4.15.25/bin/linux/$TARGETARCH/oc || { echo "Failed to download oc"; exit 1; } \
&& mkdir -m 777 -p client-tools/scm/f52a6de3e \
&& curl -f -s -L -o client-tools/scm/f52a6de3e/scm https://app.harness.io/public/shared/tools/scm/release/f52a6de3e/bin/linux/$TARGETARCH/scm || { echo "Failed to download scm"; exit 1; } \
&& mkdir -m 777 -p client-tools/kubelogin/v0.1.1 \
&& curl -f -s -L -o client-tools/kubelogin/v0.1.1/kubelogin https://app.harness.io/public/shared/tools/kubelogin/release/v0.1.1/bin/linux/$TARGETARCH/kubelogin || { echo "Failed to download kubelogin"; exit 1; } \
&& mkdir -m 777 -p client-tools/harness-credentials-plugin/v0.1.0 \
&& curl -f -s -L -o client-tools/harness-credentials-plugin/v0.1.0/harness-credentials-plugin https://app.harness.io/public/shared/tools/harness-credentials-plugin/release/v0.1.0/bin/linux/$TARGETARCH/harness-credentials-plugin || { echo "Failed to download harness-credentials-plugin"; exit 1; } \
&& curl -f -s -L -o $JAVA_HOME/bin/jattach https://app.harness.io/public/shared/tools/jattach/release/v2.2/bin/linux/$TARGETARCH/jattach || { echo "Failed to download jattach"; exit 1; } \
&& chmod +x $JAVA_HOME/bin/jattach \
&& chmod -R 775 /opt/harness-delegate \
&& chgrp -R 0 /opt/harness-delegate \
&& chown -R 1001 /opt/harness-delegate \
&& chown -R 1001 $JAVA_HOME/lib/security/cacerts
ENV PATH=/opt/harness-delegate/client-tools/kubectl/v1.28.7/:$PATH
ENV PATH=/opt/harness-delegate/client-tools/go-template/v0.4.5/:$PATH
ENV PATH=/opt/harness-delegate/client-tools/chartmuseum/v0.15.0/:$PATH
ENV PATH=/opt/harness-delegate/client-tools/tf-config-inspect/v1.2/:$PATH
ENV PATH=/opt/harness-delegate/client-tools/helm/v3.13.3/:$PATH
ENV PATH=/opt/harness-delegate/client-tools/harness-helm-post-renderer/v0.1.3/:$PATH
ENV PATH=/opt/harness-delegate/client-tools/oc/v4.15.25/:$PATH
ENV PATH=/opt/harness-delegate/client-tools/kubelogin/v0.1.1/:$PATH
ENV PATH=/opt/harness-delegate/client-tools/harness-credentials-plugin/v0.1.0/:$PATH
RUN curl -s -L -o delegate.jar $BASEURL/$DELEGATEVERSION/delegate.jar
USER 1001
CMD [ "./start.sh" ]