Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
ARG ARG_UBUNTU_BASE_IMAGE="ubuntu"
ARG ARG_UBUNTU_BASE_IMAGE_TAG="20.04"

FROM ubuntu:${ARG_UBUNTU_BASE_IMAGE_TAG}
FROM ${ARG_UBUNTU_BASE_IMAGE}:${ARG_UBUNTU_BASE_IMAGE_TAG}
WORKDIR /azp
ENV TARGETARCH=linux-x64
ENV VSTS_AGENT_VERSION=4.251.0
ARG ARG_TARGETARCH=linux-x64
ARG ARG_VSTS_AGENT_VERSION=4.251.0


# To make it easier for build and release pipelines to run apt-get,
Expand All @@ -30,8 +31,8 @@ RUN apt-get update && apt-get -y upgrade

# Download and extract the Azure DevOps Agent
RUN printenv \
&& echo "Downloading Azure DevOps Agent version ${VSTS_AGENT_VERSION} for ${TARGETARCH}"
RUN curl -LsS https://vstsagentpackage.azureedge.net/agent/${VSTS_AGENT_VERSION}/vsts-agent-${TARGETARCH}-${VSTS_AGENT_VERSION}.tar.gz | tar -xz
&& echo "Downloading Azure DevOps Agent version ${ARG_VSTS_AGENT_VERSION} for ${ARG_TARGETARCH}"
RUN curl -LsS https://vstsagentpackage.azureedge.net/agent/${ARG_VSTS_AGENT_VERSION}/vsts-agent-${ARG_TARGETARCH}-${ARG_VSTS_AGENT_VERSION}.tar.gz | tar -xz



Expand Down
12 changes: 11 additions & 1 deletion local-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ set -euo pipefail
REGISTRY="${REGISTRY:-btungut}"
TAG="${TAG:-latest}"

UBUNTU_BASE_IMAGE="${UBUNTU_BASE_IMAGE:-ubuntu}"
UBUNTU_BASE_IMAGE_TAG="${UBUNTU_BASE_IMAGE_TAG:-20.04}"
TARGETARCH="${TARGETARCH:-linux-x64}"
VSTS_AGENT_VERSION="${VSTS_AGENT_VERSION:-4.251.0}"

docker build ./src \
--build-arg ARG_UBUNTU_BASE_IMAGE=${UBUNTU_BASE_IMAGE} \
--build-arg ARG_UBUNTU_BASE_IMAGE_TAG=${UBUNTU_BASE_IMAGE_TAG} \
--build-arg ARG_TARGETARCH=${TARGETARCH} \
--build-arg ARG_VSTS_AGENT_VERSION=${VSTS_AGENT_VERSION} \
-f ./Dockerfile \
-t ${REGISTRY}/azure-devops-agent:${TAG} \
--progress=plain
--progress=plain \
"$@"