Skip to content

Commit

Permalink
Update to redhat/ubi9 for UBI based images (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienp authored Jan 7, 2025
1 parent cc1149b commit 8d93111
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Update to redhat/ubi9 for UBI based images
([342](https://github.com/pulumi/pulumi-docker-containers/pull/342))

- Update Poetry config for the Poetry 2.0 release
([#353](https://github.com/pulumi/pulumi-docker-containers/pull/353)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 2 additions & 3 deletions docker/base/Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# 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 \
make \
gcc \
git \
Expand All @@ -13,7 +12,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
Expand Down
6 changes: 2 additions & 4 deletions docker/dotnet/Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# 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 \
gzip \
tar
# Install the Pulumi SDK, including the CLI and language runtimes.
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

RUN microdnf install -y \
ca-certificates \
curl \
# Required by the dotnet-install script, which calls `find`:
findutils \
git \
Expand Down
6 changes: 2 additions & 4 deletions docker/go/Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# 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 \
gzip \
tar
# Install the Pulumi SDK, including the CLI and language runtimes.
Expand All @@ -23,13 +22,12 @@ 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

# Install needed tools, like git
RUN microdnf install -y \
curl \
git \
tar \
ca-certificates; \
Expand Down
6 changes: 2 additions & 4 deletions docker/java/Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# 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 \
git \
tar \
unzip
Expand All @@ -13,15 +12,14 @@ 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

RUN microdnf install -y \
git \
tar \
java-21-openjdk-devel \
curl \
unzip \
zip \
findutils \
Expand Down
6 changes: 2 additions & 4 deletions docker/nodejs/Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# 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 \
gzip \
tar
# Install the Pulumi SDK, including the CLI and language runtimes.
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

RUN microdnf install -y \
ca-certificates \
curl \
git \
tar \
unzip
Expand Down
4 changes: 2 additions & 2 deletions docker/python/Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tests/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,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")
})

Expand Down

0 comments on commit 8d93111

Please sign in to comment.