From f3792880c7e0121af1dbf8d10b5366611dd192df Mon Sep 17 00:00:00 2001 From: Jeff Blaine Date: Tue, 28 Jul 2026 13:43:40 -0400 Subject: [PATCH 1/3] Avoid curl conflicts Seems RHEL9 ubi (and likely others) ships with a curl-minimal package already. Trying to install `curl` throws a conflict with that. This change checks for curl's existence and only installs it if needed. Signed-off-by: Jeff Blaine --- lib/kitchen/docker/helpers/dockerfile_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/kitchen/docker/helpers/dockerfile_helper.rb b/lib/kitchen/docker/helpers/dockerfile_helper.rb index a1406b4..4dcef38 100644 --- a/lib/kitchen/docker/helpers/dockerfile_helper.rb +++ b/lib/kitchen/docker/helpers/dockerfile_helper.rb @@ -111,7 +111,9 @@ def rhel_platform <<-CODE ENV container=docker RUN yum clean all - RUN yum install -y sudo openssh-server openssh-clients which curl + RUN yum install -y which + RUN which curl || yum install -y curl + RUN yum install -y sudo openssh-server openssh-clients RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' CODE end From b751a2d953b17e047a7dc33d97247af1cfcb130e Mon Sep 17 00:00:00 2001 From: Jeff Blaine Date: Tue, 28 Jul 2026 15:30:20 -0400 Subject: [PATCH 2/3] fix: solve rhel curl conflict Signed-off-by: Jeff Blaine --- lib/kitchen/docker/helpers/dockerfile_helper.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/kitchen/docker/helpers/dockerfile_helper.rb b/lib/kitchen/docker/helpers/dockerfile_helper.rb index 4dcef38..1a95f5e 100644 --- a/lib/kitchen/docker/helpers/dockerfile_helper.rb +++ b/lib/kitchen/docker/helpers/dockerfile_helper.rb @@ -111,9 +111,8 @@ def rhel_platform <<-CODE ENV container=docker RUN yum clean all - RUN yum install -y which + RUN yum install -y sudo openssh-server openssh-clients which RUN which curl || yum install -y curl - RUN yum install -y sudo openssh-server openssh-clients RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' CODE end From 09f1674d0b895a9cbf20ef1961874fba6b7a2dc3 Mon Sep 17 00:00:00 2001 From: Jeff Blaine Date: Tue, 28 Jul 2026 17:08:14 -0400 Subject: [PATCH 3/3] Fix spec for rhel_platform changes Signed-off-by: Jeff Blaine --- spec/dockerfile_helper_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/dockerfile_helper_spec.rb b/spec/dockerfile_helper_spec.rb index 095d1a9..3d1cf45 100644 --- a/spec/dockerfile_helper_spec.rb +++ b/spec/dockerfile_helper_spec.rb @@ -61,9 +61,10 @@ def initialize(config = {}) expect(result).not_to include("--allowerasing") end - it "installs required packages including curl" do + it "installs required packages including curl if needed" do result = helper.rhel_platform - expect(result).to include("sudo openssh-server openssh-clients which curl") + expect(result).to include("sudo openssh-server openssh-clients which") + expect(result).to include("which curl || yum install -y curl") end end