/
Dockerfile
42 lines (33 loc) · 1.38 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
#based on https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops#create-and-build-the-dockerfile-1
FROM ubuntu:22.04
#install agent dependencies
RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
apt-transport-https \
apt-utils \
ca-certificates \
curl \
gnupg \
git \
git-lfs \
iputils-ping \
jq \
zip \
lsb-release \
software-properties-common \
libicu70
ARG TARGETARCH
#install kubectl to use kubeexec to access other containers inside pod
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl" && install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && kubectl version --client
#install agent dependencies
RUN curl -sL 'https://azurecliprod.blob.core.windows.net/$root/deb_install.sh' | bash
#download agent and setup startup
# ENV TARGETARCH='linux-x64'
# ENV TARGETARCH='linux-arm64'
WORKDIR /azp
ENV AGENT_VERSION="3.232.3"
ENV AGENT_PLATFORM=${TARGETARCH}
RUN if [ "${TARGETARCH}" = "amd64" ]; then export AGENT_PLATFORM='x64'; fi; curl -LsS https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/vsts-agent-linux-${AGENT_PLATFORM}-${AGENT_VERSION}.tar.gz | tar -xz & wait $!
RUN echo $AGENT_PLATFORM
COPY ./*.sh .
RUN chmod +x start.sh execContainer.sh
ENTRYPOINT [ "./start.sh" ]