Skip to content

Commit

Permalink
feat(azure): replace base image with alpine (#59)
Browse files Browse the repository at this point in the history
- replace base image with alpine
- install azure-cli using pip
- use multi-stage build for azure
  • Loading branch information
mbialon authored Nov 20, 2024
1 parent 2646a61 commit 69b717c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,25 @@ RUN gcloud --version && \

USER spacelift

FROM base AS azure-build

RUN apk add --no-cache py3-pip gcc musl-dev python3-dev libffi-dev openssl-dev cargo make

RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

RUN pip install --no-cache-dir azure-cli

FROM base AS azure

RUN az --version && \
ENV PATH="/opt/venv/bin:$PATH"

COPY --from=azure-build /opt/venv /opt/venv

RUN apk add --no-cache py3-pip && \
az --version && \
terragrunt --version && \
python --version && \
infracost --version

USER spacelift

2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ target "gcp" {
target "azure" {
target = "azure"
platforms = ["linux/amd64", "linux/arm64"]
args = {"BASE_IMAGE": "mcr.microsoft.com/azure-cli:2.63.0"}
args = {"BASE_IMAGE": "alpine:3.20"}
}

0 comments on commit 69b717c

Please sign in to comment.