Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dockerhub): update AWS/GCP/Azure clients in support Docker images #6141

Merged
merged 12 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 11 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
12 changes: 6 additions & 6 deletions support/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ RUN GARDEN_DISABLE_ANALYTICS=true GARDEN_DISABLE_VERSION_CHECK=true garden util

WORKDIR /project

FROM python:3.11-alpine@sha256:e5d592c422d6e527cb946ae6abb1886c511a5e163d3543865f5a5b9b61c01584 AS aws-builder
# Apline-3.20 seems to have some issues, see https://github.com/aws/aws-cli/issues/8698#issuecomment-2135662844
FROM python:3.11.9-alpine3.19@sha256:0b5ed25d3cc27cd35c7b0352bac8ef2ebc8dd3da72a0c03caaf4eb15d9ec827a AS aws-builder

ENV AWSCLI_VERSION=2.13.15
ENV AWSCLI_SHA256="ac63e8f42c7f8775edccdc004921420159420de9185cf011952dba8fda5895ff"
ENV AWSCLI_VERSION=2.16.0
ENV AWSCLI_SHA256="f6e15071a4327e57f0aa2b8f52a35b1378528b72cb68a586302ae7ae97087d05"

RUN apk add --no-cache \
wget \
Expand Down Expand Up @@ -113,10 +114,10 @@ RUN rm -rf $(find /google-cloud-sdk/ -regex ".*/__pycache__") && rm -rf /google-
FROM garden-base-root as garden-azure-base

WORKDIR /
ENV AZURE_CLI_VERSION=2.53.0
ENV AZURE_CLI_VERSION=2.61.0

RUN wget -O requirements.txt https://raw.githubusercontent.com/Azure/azure-cli/azure-cli-$AZURE_CLI_VERSION/src/azure-cli/requirements.py3.Linux.txt && \
echo "833a12c837df6b9d8b27abf908073eb2da971c8506d2b112946be4a36e1db7af requirements.txt" | sha256sum -c
echo "8ebbef38b1278448666246483721be61320e244ddfc2edb999b475364591f2eb requirements.txt" | sha256sum -c
RUN wget -O trim_sdk.py https://raw.githubusercontent.com/Azure/azure-cli/azure-cli-$AZURE_CLI_VERSION/scripts/trim_sdk.py && \
echo "2e6292f5285b4fcedbe8efd77309fade550667d1c502a6ffa078f1aa97942c64 trim_sdk.py" | sha256sum -c

Expand Down Expand Up @@ -175,7 +176,6 @@ ENV CLOUDSDK_PYTHON=python3
COPY --chown=$USER:root --from=gcloud-base /google-cloud-sdk /google-cloud-sdk
ENV PATH /google-cloud-sdk/bin:$PATH


#
# garden-aws-gloud-azure
#
Expand Down
23 changes: 11 additions & 12 deletions support/debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ ARG VARIANT=root

# NOTE: This is not the node version Garden itself will run in. Garden binaries have node "built in" and the version installed on the system does not matter.
# The main reason we base these images off of the Node image is for Azure DevOps Support.
FROM node:20.13.1-buster-slim@sha256:7ab273816c6bc500ddba1400d825708a5a5ed963cdc17c32d3fce70ac9a0f477 as garden-buster-base-root
FROM node:22.2.0-bookworm-slim@sha256:840079c08ec485123cf7ea506a13afea630db25606f71e6140cf8dbdf9bba552 as garden-bookworm-base-root
vvagaytsev marked this conversation as resolved.
Show resolved Hide resolved

FROM garden-buster-base-root as garden-base-root
FROM garden-bookworm-base-root as garden-base-root
# system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -49,7 +49,6 @@ FROM garden-base-root as garden-base-rootless
ENV USER=gardenuser
ENV HOME=/home/gardenuser
RUN useradd -ms /bin/bash $USER

USER $USER

FROM garden-base-$VARIANT as garden-base
Expand All @@ -69,8 +68,8 @@ WORKDIR /project
# garden-aws-base
#
FROM garden-base-root as garden-aws-base
ENV AWSCLI_VERSION=2.13.15
ENV AWSCLI_SHA256="45d2e0f304eb0f57e6b58ffc0664879c0bc1cf8365fd2f64bcb5f3bbf2e9434f"
ENV AWSCLI_VERSION=2.16.0
ENV AWSCLI_SHA256="e44efc8de54156d6d8c1d158c1976992f4045b85e550668ce4c6daf5d8777e2d"

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWSCLI_VERSION}.zip" -o "awscliv2.zip"
RUN echo "${AWSCLI_SHA256} awscliv2.zip" | sha256sum -c
Expand All @@ -81,8 +80,8 @@ RUN ./aws/install
# garden-gcloud-base
#
FROM garden-base as garden-gcloud-base
ENV GCLOUD_VERSION=444.0.0
ENV GCLOUD_SHA256="cc76b9b40508253f812af5e52d4630e90230312969eece04ccfb5328c557acac"
ENV GCLOUD_VERSION=478.0.0
ENV GCLOUD_SHA256="225c3a1f9b47241467a4ad8da0f432a57bade10c8d44158920003ae698f6d195"

RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-${GCLOUD_VERSION}-linux-x86_64.tar.gz
RUN echo "${GCLOUD_SHA256} google-cloud-cli-${GCLOUD_VERSION}-linux-x86_64.tar.gz" | sha256sum -c
Expand All @@ -94,7 +93,7 @@ RUN ./google-cloud-sdk/bin/gcloud components install kubectl gke-gcloud-auth-plu
# garden-azure-base
#
FROM garden-base-root as garden-azure-base
ENV AZURE_CLI_VERSION=2.53.0
ENV AZURE_CLI_VERSION=2.61.0

RUN apt-get update
RUN apt-get install ca-certificates curl apt-transport-https lsb-release gnupg
Expand All @@ -105,7 +104,7 @@ RUN chmod go+r /etc/apt/keyrings/microsoft.gpg
RUN echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | \
tee /etc/apt/sources.list.d/azure-cli.list
RUN apt-get update
RUN apt-get install azure-cli=${AZURE_CLI_VERSION}-1~buster
RUN apt-get install azure-cli=${AZURE_CLI_VERSION}-1~bookworm
RUN az aks install-cli

#
Expand All @@ -123,7 +122,7 @@ COPY --chown=$USER:root --from=garden-azure-base /usr/local/bin/kubelogin /usr/l
# garden-aws
#
FROM garden-base as garden-aws
ENV AWSCLI_VERSION=2.13.15
ENV AWSCLI_VERSION=2.16.0
# Copy aws cli
RUN mkdir -p ${HOME}/aws-cli
COPY --chown=$USER:root --from=garden-aws-base /usr/local/aws-cli ${HOME}/aws-cli
Expand All @@ -144,7 +143,7 @@ ENV PATH /google-cloud-sdk/bin:$PATH
# garden-aws-gloud
#
FROM garden-base as garden-aws-gcloud
ENV AWSCLI_VERSION=2.13.15
ENV AWSCLI_VERSION=2.16.0

# Copy aws cli
RUN mkdir -p ${HOME}/aws-cli
Expand All @@ -161,7 +160,7 @@ ENV PATH /google-cloud-sdk/bin:$PATH
# garden-aws-gloud-azure
#
FROM garden-base as garden-aws-gcloud-azure
ENV AWSCLI_VERSION=2.13.15
ENV AWSCLI_VERSION=2.16.0

# Copy aws cli
RUN mkdir -p ${HOME}/aws-cli
Expand Down
58 changes: 29 additions & 29 deletions support/docker-bake-test.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TEST "test cloud provider tool availability"
docker buildx bake --progress=plain -f "$(dirname "$0")/docker-bake.hcl" all

# aws
for variant in bonsai{-alpine,-buster}{,-rootless}
for variant in bonsai{-alpine,-bookworm}{,-rootless}
do
echo "gardendev/garden-aws-gcloud-azure:$variant"
should_succeed aws --version gardendev/garden-aws-gcloud-azure:$variant
Expand Down Expand Up @@ -101,7 +101,7 @@ TEST "run all binaries"
MAJOR_VERSION=0 MINOR_VERSION=13 PATCH_VERSION=0 CODENAME=bonsai \
docker buildx bake --progress=plain -f "$(dirname "$0")/docker-bake.hcl" all

for variant in bonsai{-alpine,-buster}{,-rootless}
for variant in bonsai{-alpine,-bookworm}{,-rootless}
do
# Garden on vanilla images
should_succeed garden version gardendev/garden:$variant
Expand Down Expand Up @@ -131,17 +131,17 @@ TEST "run all binaries"

TEST "edge tags for debian"
MAJOR_VERSION=0 MINOR_VERSION=13 PRERELEASE=edge CODENAME=bonsai \
docker buildx bake --progress=plain -f "$(dirname "$0")/docker-bake.hcl" buster
docker buildx bake --progress=plain -f "$(dirname "$0")/docker-bake.hcl" bookworm

for image in gardendev/garden{,-aws,-azure,-gcloud,-aws-gcloud,-aws-gcloud-azure}
do
should_not_exist $image latest
should_not_exist $image 0.13-buster
should_not_exist $image 0.13-buster-rootless
should_exist $image 0.13-edge-buster
should_exist $image 0.13-edge-buster-rootless
should_exist $image bonsai-edge-buster
should_exist $image bonsai-edge-buster-rootless
should_not_exist $image 0.13-bookworm
should_not_exist $image 0.13-bookworm-rootless
should_exist $image 0.13-edge-bookworm
should_exist $image 0.13-edge-bookworm-rootless
should_exist $image bonsai-edge-bookworm
should_exist $image bonsai-edge-bookworm-rootless
done

TEST "edge tags for alpine"
Expand All @@ -161,20 +161,20 @@ TEST "edge tags for alpine"

TEST "prerelase tags for debian"
MAJOR_VERSION=0 MINOR_VERSION=13 PATCH_VERSION=0 PRERELEASE=alpha1 CODENAME=bonsai \
docker buildx bake --progress=plain -f "$(dirname "$0")/docker-bake.hcl" buster
docker buildx bake --progress=plain -f "$(dirname "$0")/docker-bake.hcl" bookworm


for image in gardendev/garden{,-aws,-azure,-gcloud,-aws-gcloud,-aws-gcloud-azure}
do
should_not_exist $image latest
should_not_exist $image 0.13-buster
should_not_exist $image 0.13-buster-rootless
should_not_exist $image 0.13-alpha1-buster
should_not_exist $image 0.13-alpha1-buster-rootless
should_not_exist $image bonsai-alpha1-buster
should_not_exist $image bonsai-alpha1-buster-rootless
should_exist gardendev/garden 0.13.0-alpha1-buster
should_exist gardendev/garden 0.13.0-alpha1-buster-rootless
should_not_exist $image 0.13-bookworm
should_not_exist $image 0.13-bookworm-rootless
should_not_exist $image 0.13-alpha1-bookworm
should_not_exist $image 0.13-alpha1-bookworm-rootless
should_not_exist $image bonsai-alpha1-bookworm
should_not_exist $image bonsai-alpha1-bookworm-rootless
should_exist gardendev/garden 0.13.0-alpha1-bookworm
should_exist gardendev/garden 0.13.0-alpha1-bookworm-rootless
done

TEST "prerelease tags for alpine"
Expand All @@ -196,22 +196,22 @@ TEST "prerelease tags for alpine"

TEST "production release tags for debian"
MAJOR_VERSION=0 MINOR_VERSION=13 PATCH_VERSION=0 CODENAME=bonsai \
docker buildx bake --progress=plain -f "$(dirname "$0")/docker-bake.hcl" buster
docker buildx bake --progress=plain -f "$(dirname "$0")/docker-bake.hcl" bookworm


for image in gardendev/garden{,-aws,-azure,-gcloud,-aws-gcloud,-aws-gcloud-azure}
do
should_not_exist $image latest
should_exist $image 0.13-buster
should_exist $image 0.13-buster-rootless
should_exist $image 0.13.0-buster
should_exist $image 0.13.0-buster-rootless
should_exist $image bonsai-buster
should_exist $image bonsai-buster-rootless
should_not_exist $image 0.13-edge-buster
should_not_exist $image 0.13-edge-buster-rootless
should_not_exist $image bonsai-edge-buster
should_not_exist $image bonsai-edge-buster-rootless
should_exist $image 0.13-bookworm
should_exist $image 0.13-bookworm-rootless
should_exist $image 0.13.0-bookworm
should_exist $image 0.13.0-bookworm-rootless
should_exist $image bonsai-bookworm
should_exist $image bonsai-bookworm-rootless
should_not_exist $image 0.13-edge-bookworm
should_not_exist $image 0.13-edge-bookworm-rootless
should_not_exist $image bonsai-edge-bookworm
should_not_exist $image bonsai-edge-bookworm-rootless
done

TEST "production release tags for alpine"
Expand Down
60 changes: 30 additions & 30 deletions support/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,25 @@ function "repository" {
##

group "all" {
targets = ["buster", "alpine"]
targets = ["bookworm", "alpine"]
}

group "buster" {
group "bookworm" {
targets = [
# Root buster
"buster-base",
"buster-aws",
"buster-azure",
"buster-gcloud",
"buster-aws-gcloud",
"buster-aws-gcloud-azure",
# Rootless buster
"buster-rootless",
"buster-aws-rootless",
"buster-azure-rootless",
"buster-gcloud-rootless",
"buster-aws-gcloud-rootless",
"buster-aws-gcloud-azure-rootless",
stefreak marked this conversation as resolved.
Show resolved Hide resolved
# Root bookworm
"bookworm-base",
"bookworm-aws",
"bookworm-azure",
"bookworm-gcloud",
"bookworm-aws-gcloud",
"bookworm-aws-gcloud-azure",
# Rootless bookworm
"bookworm-rootless",
"bookworm-aws-rootless",
"bookworm-azure-rootless",
"bookworm-gcloud-rootless",
"bookworm-aws-gcloud-rootless",
"bookworm-aws-gcloud-azure-rootless",
]
}

Expand All @@ -117,12 +117,12 @@ group "alpine" {
## Images
##

target "buster-base" {
target "bookworm-base" {
dockerfile = "../../support/debian.Dockerfile"
target = "garden-base"
platforms = ["linux/amd64"]
context = "dist/linux-amd64"
tags = repository("gardendev/garden", tags("buster"))
tags = repository("gardendev/garden", tags("bookworm"))
}

target "alpine-base" {
Expand All @@ -136,7 +136,7 @@ target "alpine-base" {
target "aws" {
name = "${distro}-aws"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-base"]
target = "garden-aws"
Expand All @@ -146,7 +146,7 @@ target "aws" {
target "azure" {
name = "${distro}-azure"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-base"]
target = "garden-azure"
Expand All @@ -156,7 +156,7 @@ target "azure" {
target "gcloud" {
name = "${distro}-gcloud"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-base"]
target = "garden-gcloud"
Expand All @@ -166,7 +166,7 @@ target "gcloud" {
target "aws-gcloud" {
name = "${distro}-aws-gcloud"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-base"]
target = "garden-aws-gcloud"
Expand All @@ -176,7 +176,7 @@ target "aws-gcloud" {
target "aws-gcloud-azure" {
name = "${distro}-aws-gcloud-azure"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-base"]
target = "garden-aws-gcloud-azure"
Expand All @@ -190,7 +190,7 @@ target "aws-gcloud-azure" {
target "rootless" {
name = "${distro}-rootless"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-base"]
tags = repository("gardendev/garden", tags("${distro}-rootless"))
Expand All @@ -202,7 +202,7 @@ target "rootless" {
target "aws-rootless" {
name = "${distro}-aws-rootless"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-rootless", "${distro}-aws"]
tags = repository("gardendev/garden-aws", tags("${distro}-rootless"))
Expand All @@ -211,7 +211,7 @@ target "aws-rootless" {
target "azure-rootless" {
name = "${distro}-azure-rootless"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-rootless", "${distro}-azure"]
tags = repository("gardendev/garden-azure", tags("${distro}-rootless"))
Expand All @@ -220,7 +220,7 @@ target "azure-rootless" {
target "gcloud-rootless" {
name = "${distro}-gcloud-rootless"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-rootless", "${distro}-gcloud"]
tags = repository("gardendev/garden-gcloud", tags("${distro}-rootless"))
Expand All @@ -229,7 +229,7 @@ target "gcloud-rootless" {
target "aws-gcloud-rootless" {
name = "${distro}-aws-gcloud-rootless"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-rootless", "${distro}-aws-gcloud"]
tags = repository("gardendev/garden-aws-gcloud", tags("${distro}-rootless"))
Expand All @@ -238,8 +238,8 @@ target "aws-gcloud-rootless" {
target "aws-gcloud-azure-rootless" {
name = "${distro}-aws-gcloud-azure-rootless"
matrix = {
distro = ["buster", "alpine"]
distro = ["bookworm", "alpine"]
}
inherits = ["${distro}-rootless", "${distro}-aws-gcloud-azure"]
tags = repository("gardendev/garden-aws-gcloud-azure", tags("${distro}-rootless"))
}
}