Skip to content

Commit

Permalink
Define version of Image Builder image with Azure CLI installed (#1068)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthalman authored Oct 26, 2022
1 parent 8361a75 commit ed310cb
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 5 deletions.
30 changes: 30 additions & 0 deletions src/Microsoft.DotNet.ImageBuilder/Dockerfile.az.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG PYTHON_VERSION=3.10
ARG ARCH=amd64

# Azure CLI installer
FROM mcr.microsoft.com/dotnet-buildtools/image-builder:linux-$ARCH AS az-installer

ARG PYTHON_VERSION

# install Azure CLI
RUN apk add --no-cache \
cargo \
gcc \
libffi-dev \
make \
musl-dev \
openssl-dev \
py3-pip \
python3-dev~=$PYTHON_VERSION

RUN pip install azure-cli


# build final image
FROM mcr.microsoft.com/dotnet-buildtools/image-builder:linux-$ARCH

ARG PYTHON_VERSION
RUN apk add python3~=$PYTHON_VERSION

COPY --from=az-installer /usr/bin/az /usr/bin/az
COPY --from=az-installer /usr/lib/python$PYTHON_VERSION/site-packages /usr/lib/python$PYTHON_VERSION/site-packages
6 changes: 3 additions & 3 deletions src/Microsoft.DotNet.ImageBuilder/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ RUN apk add --no-cache \
git

# install manifest-tool
ARG MANIFEST_TOOL_ARCH=amd64
ARG ARCH=amd64
RUN manifestToolVersion="2.0.6" \
&& wget -O binaries-manifest-tool.tar.gz \
"https://github.com/estesp/manifest-tool/releases/download/v$manifestToolVersion/binaries-manifest-tool-$manifestToolVersion.tar.gz" \
&& echo "4d8a502f2d3b82a50cfde65274ff6df7ef6fe441dc65b96b595a70cc64ece5bc binaries-manifest-tool.tar.gz" | sha256sum -c - \
&& tar -zxf binaries-manifest-tool.tar.gz -C /usr/local/bin manifest-tool-linux-$MANIFEST_TOOL_ARCH \
&& mv /usr/local/bin/manifest-tool-linux-$MANIFEST_TOOL_ARCH /usr/local/bin/manifest-tool \
&& tar -zxf binaries-manifest-tool.tar.gz -C /usr/local/bin manifest-tool-linux-$ARCH \
&& mv /usr/local/bin/manifest-tool-linux-$ARCH /usr/local/bin/manifest-tool \
&& chmod +x /usr/local/bin/manifest-tool \
&& rm binaries-manifest-tool.tar.gz

Expand Down
42 changes: 40 additions & 2 deletions src/Microsoft.DotNet.ImageBuilder/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"buildArgs": {
"RID_ARCH": "x64",
"MANIFEST_TOOL_ARCH": "amd64",
"ARCH": "amd64",
"ALPINE_TAG_SUFFIX": ""
},
"dockerfile": "Dockerfile.linux",
Expand All @@ -27,7 +27,7 @@
{
"buildArgs": {
"RID_ARCH": "arm64",
"MANIFEST_TOOL_ARCH": "arm64",
"ARCH": "arm64",
"ALPINE_TAG_SUFFIX": "-arm64v8"
},
"architecture": "arm64",
Expand Down Expand Up @@ -77,6 +77,44 @@
}
}
]
},
{
"sharedTags": {
"az": {},
"$(UniqueId)-az": {}
},
"platforms": [
{
"buildArgs": {
"RID_ARCH": "x64",
"ARCH": "amd64",
"ALPINE_TAG_SUFFIX": ""
},
"dockerfile": "Dockerfile.az.linux",
"os": "linux",
"osVersion": "alpine",
"tags": {
"linux-amd64-az": {},
"linux-amd64-$(UniqueId)-az": {}
}
},
{
"buildArgs": {
"RID_ARCH": "arm64",
"ARCH": "arm64",
"ALPINE_TAG_SUFFIX": "-arm64v8"
},
"architecture": "arm64",
"dockerfile": "Dockerfile.az.linux",
"os": "linux",
"osVersion": "alpine",
"tags": {
"linux-arm64-az": {},
"linux-arm64-$(UniqueId)-az": {}
},
"variant": "v8"
}
]
}
]
}
Expand Down

0 comments on commit ed310cb

Please sign in to comment.