From c0ee8b1dc71a76bf33c699f038a50f77ba7afa58 Mon Sep 17 00:00:00 2001 From: Julien Poissonnier Date: Mon, 16 Dec 2024 11:11:39 +0100 Subject: [PATCH 1/5] Update to redhat/ubi9 for UBI based images Fixes https://github.com/pulumi/pulumi-docker-containers/issues/338 --- README.md | 2 +- docker/base/Dockerfile.ubi | 4 ++-- docker/dotnet/Dockerfile.ubi | 4 ++-- docker/go/Dockerfile.ubi | 4 ++-- docker/java/Dockerfile.ubi | 4 ++-- docker/nodejs/Dockerfile.ubi | 4 ++-- docker/python/Dockerfile.ubi | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a5ad571c..3c110f00 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Each of the images described above (except the full `pulumi/pulumi` image) are b - `-debian-amd64`: Image manifest for the `linux/amd64` platform. - `-debian-arm64`: Image manifest for the `linux/arm64` platform. - `-debian`: Manifest list of `-debian-amd64` and `-debian-arm64`. Executing `docker pull` against this tag will grab the appropriate image for the supported platform you are currently running, and thus should be the default choice. -- [redhat/ubi8-minimal](https://hub.docker.com/r/redhat/ubi8-minimal), tagged with a suffix of `-ubi`. UBI images use [`microdnf`](https://github.com/rpm-software-management/microdnf) as a package manager instead of yum to minimize the size of the image. We currently only support `linux/amd64` for our UBI SDK images. +- [redhat/ubi9-minimal](https://hub.docker.com/r/redhat/ubi9-minimal), tagged with a suffix of `-ubi`. UBI images use [`microdnf`](https://github.com/rpm-software-management/microdnf) as a package manager instead of yum to minimize the size of the image. We currently only support `linux/amd64` for our UBI SDK images. Images with no suffix tag are identical to the corresponding `-debian` tag. diff --git a/docker/base/Dockerfile.ubi b/docker/base/Dockerfile.ubi index e1c36e9e..1dee29ed 100644 --- a/docker/base/Dockerfile.ubi +++ b/docker/base/Dockerfile.ubi @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:experimental -FROM redhat/ubi8-minimal:latest as builder +FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ curl \ @@ -13,7 +13,7 @@ RUN curl -fsSL https://get.pulumi.com/ | bash -s -- --version $PULUMI_VERSION # The runtime container # This is our base container, so let's copy all the runtimes to .pulumi/bin -FROM redhat/ubi8-minimal:latest +FROM redhat/ubi9-minimal:latest LABEL org.opencontainers.image.description="Pulumi CLI container, bring your own SDK" WORKDIR /pulumi COPY --from=builder /root/.pulumi/bin bin diff --git a/docker/dotnet/Dockerfile.ubi b/docker/dotnet/Dockerfile.ubi index 3315161d..f4ce17e6 100644 --- a/docker/dotnet/Dockerfile.ubi +++ b/docker/dotnet/Dockerfile.ubi @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:experimental # Interim container so we can copy pulumi binaries -FROM redhat/ubi8-minimal:latest as builder +FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ curl \ @@ -10,7 +10,7 @@ RUN microdnf install -y \ RUN curl -fsSL https://get.pulumi.com/ | bash -s -- --version $PULUMI_VERSION # The runtime container -FROM redhat/ubi8-minimal:latest +FROM redhat/ubi9-minimal:latest ARG LANGUAGE_VERSION LABEL org.opencontainers.image.description="Pulumi CLI container for dotnet" WORKDIR /pulumi/projects diff --git a/docker/go/Dockerfile.ubi b/docker/go/Dockerfile.ubi index 5de8bc68..dc32c28f 100644 --- a/docker/go/Dockerfile.ubi +++ b/docker/go/Dockerfile.ubi @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:experimental # Interim container so we can copy pulumi binaries -FROM redhat/ubi8-minimal:latest as builder +FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ curl \ @@ -23,7 +23,7 @@ RUN curl -fsSLo /tmp/go.tgz https://golang.org/dl/go${RUNTIME_VERSION}.linux-amd go version # The runtime container -FROM redhat/ubi8-minimal:latest +FROM redhat/ubi9-minimal:latest LABEL org.opencontainers.image.description="Pulumi CLI container for go" WORKDIR /pulumi/projects diff --git a/docker/java/Dockerfile.ubi b/docker/java/Dockerfile.ubi index 3c0ba994..b1f99080 100644 --- a/docker/java/Dockerfile.ubi +++ b/docker/java/Dockerfile.ubi @@ -1,7 +1,7 @@ # syntax = docker/dockerfile:experimental # Interim container so we can copy pulumi binaries # Must be defined first -FROM redhat/ubi8-minimal:latest as builder +FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ curl \ @@ -13,7 +13,7 @@ RUN microdnf install -y \ RUN curl -fsSL https://get.pulumi.com/ | bash -s -- --version $PULUMI_VERSION # The runtime container -FROM redhat/ubi8-minimal:latest +FROM redhat/ubi9-minimal:latest LABEL org.opencontainers.image.description="Pulumi CLI container for Java" WORKDIR /pulumi/projects diff --git a/docker/nodejs/Dockerfile.ubi b/docker/nodejs/Dockerfile.ubi index 7a95949f..4b0a0068 100644 --- a/docker/nodejs/Dockerfile.ubi +++ b/docker/nodejs/Dockerfile.ubi @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:experimental # Interim container so we can copy pulumi binaries -FROM redhat/ubi8-minimal:latest as builder +FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ curl \ @@ -10,7 +10,7 @@ RUN microdnf install -y \ RUN curl -fsSL https://get.pulumi.com/ | bash -s -- --version $PULUMI_VERSION # The runtime container -FROM redhat/ubi8-minimal:latest +FROM redhat/ubi9-minimal:latest ARG LANGUAGE_VERSION LABEL org.opencontainers.image.description="Pulumi CLI container for nodejs" WORKDIR /pulumi/projects diff --git a/docker/python/Dockerfile.ubi b/docker/python/Dockerfile.ubi index 461cc833..1f0a713a 100644 --- a/docker/python/Dockerfile.ubi +++ b/docker/python/Dockerfile.ubi @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:experimental # Interim container so we can copy pulumi binaries -FROM redhat/ubi8-minimal:latest as builder +FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ gzip \ @@ -9,7 +9,7 @@ RUN microdnf install -y \ RUN curl -fsSL https://get.pulumi.com/ | bash -s -- --version $PULUMI_VERSION # The runtime container -FROM redhat/ubi8-minimal:latest +FROM redhat/ubi9-minimal:latest ARG LANGUAGE_VERSION LABEL org.opencontainers.image.description="Pulumi CLI container for python" WORKDIR /pulumi/projects From fb49a6f4299001c08701d914e16cfcab924d7081 Mon Sep 17 00:00:00 2001 From: Julien Poissonnier Date: Mon, 16 Dec 2024 11:14:42 +0100 Subject: [PATCH 2/5] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11a5c9ab..5e35dd7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- Update to redhat/ubi9 for UBI based images + ([342](https://github.com/pulumi/pulumi-docker-containers/pull/342)) + - Include uv in images that provide Python -([341](https://github.com/pulumi/pulumi-docker-containers/pull/341)) From 78759e995af3b155835438b408c7d32494e3fbc2 Mon Sep 17 00:00:00 2001 From: Julien Poissonnier Date: Mon, 16 Dec 2024 18:20:26 +0100 Subject: [PATCH 3/5] curl is in the ubi9 base image --- docker/base/Dockerfile.ubi | 1 - docker/dotnet/Dockerfile.ubi | 2 -- docker/go/Dockerfile.ubi | 1 - docker/java/Dockerfile.ubi | 2 -- docker/nodejs/Dockerfile.ubi | 2 -- 5 files changed, 8 deletions(-) diff --git a/docker/base/Dockerfile.ubi b/docker/base/Dockerfile.ubi index 1dee29ed..566b2e57 100644 --- a/docker/base/Dockerfile.ubi +++ b/docker/base/Dockerfile.ubi @@ -2,7 +2,6 @@ FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ - curl \ make \ gcc \ git \ diff --git a/docker/dotnet/Dockerfile.ubi b/docker/dotnet/Dockerfile.ubi index f4ce17e6..1acb9b3d 100644 --- a/docker/dotnet/Dockerfile.ubi +++ b/docker/dotnet/Dockerfile.ubi @@ -3,7 +3,6 @@ FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ - curl \ gzip \ tar # Install the Pulumi SDK, including the CLI and language runtimes. @@ -17,7 +16,6 @@ WORKDIR /pulumi/projects RUN microdnf install -y \ ca-certificates \ - curl \ # Required by the dotnet-install script, which calls `find`: findutils \ git \ diff --git a/docker/go/Dockerfile.ubi b/docker/go/Dockerfile.ubi index dc32c28f..70b10f8c 100644 --- a/docker/go/Dockerfile.ubi +++ b/docker/go/Dockerfile.ubi @@ -3,7 +3,6 @@ FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ - curl \ gzip \ tar # Install the Pulumi SDK, including the CLI and language runtimes. diff --git a/docker/java/Dockerfile.ubi b/docker/java/Dockerfile.ubi index b1f99080..86423ae4 100644 --- a/docker/java/Dockerfile.ubi +++ b/docker/java/Dockerfile.ubi @@ -4,7 +4,6 @@ FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ - curl \ git \ tar \ unzip @@ -21,7 +20,6 @@ RUN microdnf install -y \ git \ tar \ java-21-openjdk-devel \ - curl \ unzip \ zip \ findutils \ diff --git a/docker/nodejs/Dockerfile.ubi b/docker/nodejs/Dockerfile.ubi index 4b0a0068..a80b92c0 100644 --- a/docker/nodejs/Dockerfile.ubi +++ b/docker/nodejs/Dockerfile.ubi @@ -3,7 +3,6 @@ FROM redhat/ubi9-minimal:latest as builder ARG PULUMI_VERSION RUN microdnf install -y \ - curl \ gzip \ tar # Install the Pulumi SDK, including the CLI and language runtimes. @@ -17,7 +16,6 @@ WORKDIR /pulumi/projects RUN microdnf install -y \ ca-certificates \ - curl \ git \ tar \ unzip From 2317f26924803f40d4874d118c3fce7fa992480f Mon Sep 17 00:00:00 2001 From: Julien Poissonnier Date: Mon, 16 Dec 2024 18:30:30 +0100 Subject: [PATCH 4/5] Add /root/.local/bin:/root/bin: to UBI Bash Path --- tests/containers_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/containers_test.go b/tests/containers_test.go index 64a43370..cc5e73ff 100644 --- a/tests/containers_test.go +++ b/tests/containers_test.go @@ -399,6 +399,10 @@ func TestEnvironment(t *testing.T) { if imageVariant == "pulumi" { expectedPath += ":/root/.pulumi/bin" } + // When running in bash, the UBI images include /root/.local/bin:/root/bin: + if isUBI(t) { + expectedPath = "/root/.local/bin:/root/bin:" + expectedPath + } requireOutputWithBash(t, expectedPath, "printenv", "PATH") }) From f92ed6c0bf95ffad2231eddd58b9b3f13a160c2c Mon Sep 17 00:00:00 2001 From: Julien Poissonnier Date: Tue, 17 Dec 2024 09:57:53 +0100 Subject: [PATCH 5/5] fix go --- docker/go/Dockerfile.ubi | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/go/Dockerfile.ubi b/docker/go/Dockerfile.ubi index 70b10f8c..a0f05fd3 100644 --- a/docker/go/Dockerfile.ubi +++ b/docker/go/Dockerfile.ubi @@ -28,7 +28,6 @@ WORKDIR /pulumi/projects # Install needed tools, like git RUN microdnf install -y \ - curl \ git \ tar \ ca-certificates; \