-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
86 lines (73 loc) · 3.77 KB
/
Dockerfile
File metadata and controls
86 lines (73 loc) · 3.77 KB
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
FROM ghcr.io/actions/actions-runner:2.334.0@sha256:b6614fce332517f74d0a76e7c762fb08e4f2ff13dcf333183397c8a5725b6e8e AS base
USER root
RUN apt-get update \
&& apt-get -y install curl git \
&& apt-get -y install jq \
&& apt-get -y install zip unzip \
&& apt-get -y install build-essential \
&& apt-get -y install openjdk-17-jdk \
&& apt-get -y install ca-certificates wget apt-transport-https lsb-release gnupg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
FROM base AS deps
RUN bash bin/installdependencies.sh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
FROM deps AS deps-az
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
RUN AZ_REPO=$(lsb_release -cs) && \
echo "deb [arch=$(dpkg --print-architecture)] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list
RUN apt-get update && \
apt-get -y install azure-cli \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN az config set extension.use_dynamic_install=yes_without_prompt
ENV KUBELOGIN_VERSION="${ENV_KUBELOGIN_VERSION:-0.2.10}"
RUN az aks install-cli --kubelogin-version "${KUBELOGIN_VERSION}"
FROM deps-az AS deps-kube
RUN apt-get install curl gpg apt-transport-https --yes
RUN curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null
RUN echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | tee /etc/apt/sources.list.d/helm-stable-debian.list
RUN apt-get update \
&& apt-get install helm -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
FROM deps-kube AS deps-yq
ENV YQ_VERSION="v4.47.1"
ENV YQ_BINARY="yq_linux_amd64"
RUN wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}.tar.gz -O - | tar xz && mv ${YQ_BINARY} /usr/bin/yq
FROM deps-yq AS deps-node-yarn
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/nodesource.gpg
ENV NODE_MAJOR_VERSION="20"
RUN echo "deb [signed-by=/etc/apt/trusted.gpg.d/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update \
&& apt-get -y install nodejs \
&& sleep 5s \
&& npm install --global yarn@v1.22.22 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
FROM deps-node-yarn AS deps-docker-compose
RUN curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose
FROM deps-docker-compose AS deps-gh-cli
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg;
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null;
RUN apt update \
&& apt install -y gh
FROM deps-gh-cli AS final
COPY ./github-runner-entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
USER runner
RUN whoami \
&& echo "az cli: $(az version)" \
&& echo "kubectl client: $(kubectl version --client -o yaml)" \
&& echo "kubelogin client: $(kubelogin --version)" \
&& echo "helm: $(helm version)" \
&& echo "yq: $(yq --version)" \
&& echo "java: $(java --version)" \
&& echo "node: $(node --version)" \
&& echo "npm: $(npm --version)" \
&& echo "yarn: $(yarn --version)" \
&& echo "docker-compose: $(docker-compose --version)" \
&& echo "gh: $(gh --version)"
ENTRYPOINT ["./entrypoint.sh"]