Skip to content

Commit 971eb1b

Browse files
test(nrdot): preemptively remove pre-installed containerd before docker-ce
Follow-up to eb0ea25. The 'allowerasing' flag alone doesn't unblock the docker-ce install on newer RHEL 9 AMIs: the conflict is an RPM-level 'Conflicts:' declaration between RHEL AppStream's 'containerd' and docker.com's 'containerd.io', which fails at dnf's transaction check stage (before allowerasing gets a chance to resolve deps). Preemptively remove any pre-installed 'containerd' / 'containerd.io' packages (both dnf-remove and rpm -e --nodeps as a fallback) so the subsequent docker-ce.repo install can bring in its own containerd.io cleanly. Applies to both nrdot RHEL 9 deploy scripts (kafka, rabbitmq).
1 parent eb0ea25 commit 971eb1b

2 files changed

Lines changed: 23 additions & 10 deletions

File tree

  • test/deploy/linux
    • nrdot-kafka/install/rhel/roles/configure/tasks
    • nrdot-rabbitmq/install/rhel/roles/configure/tasks

test/deploy/linux/nrdot-kafka/install/rhel/roles/configure/tasks/main.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@
1414
args:
1515
creates: /etc/yum.repos.d/docker-ce.repo
1616

17+
# Newer RHEL 9 AMIs ship containerd.io pre-installed from the AppStream
18+
# repo. When we later add docker-ce.repo and try to install docker-ce,
19+
# dnf's transitive resolver pulls RHEL's `containerd` package (from
20+
# AppStream), which has an RPM-level Conflicts: against the pre-installed
21+
# `containerd.io`. The transaction check then fails even with
22+
# allowerasing=true, because it's an RPM conflict, not a dep-resolution
23+
# ambiguity. Preemptively remove any pre-installed containerd* so
24+
# docker-ce.repo's containerd.io can install cleanly.
25+
- name: remove any pre-installed containerd packages (avoid docker-ce install conflict)
26+
shell: |
27+
dnf remove -y containerd containerd.io 2>/dev/null || true
28+
rpm -e --nodeps containerd containerd.io 2>/dev/null || true
29+
true
30+
1731
- name: install Docker CE with compose and buildx plugins
1832
dnf:
1933
name:
@@ -23,11 +37,6 @@
2337
- docker-compose-plugin
2438
- docker-buildx-plugin
2539
state: present
26-
# Newer RHEL 9 AMIs ship containerd.io pre-installed; without
27-
# allowerasing, yum's transitive dep resolution tries to install
28-
# RHEL's own 'containerd' package which conflicts with the pre-
29-
# installed 'containerd.io' and the transaction fails.
30-
allowerasing: yes
3140

3241
- name: start and enable Docker
3342
systemd:

test/deploy/linux/nrdot-rabbitmq/install/rhel/roles/configure/tasks/main.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
else
1515
yum install -y yum-utils
1616
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
17-
# Newer RHEL 9 AMIs ship containerd.io pre-installed; without
18-
# --allowerasing, dnf's transitive dep resolution tries to install
19-
# RHEL's own 'containerd' package which conflicts with the pre-
20-
# installed 'containerd.io' and the transaction fails.
21-
yum install --allowerasing -y docker-ce docker-ce-cli containerd.io
17+
# Newer RHEL 9 AMIs ship containerd.io pre-installed from AppStream.
18+
# docker-ce install pulls RHEL's `containerd` as a transitive dep,
19+
# which has an RPM-level Conflicts: with the pre-installed
20+
# containerd.io — the check fails even with --allowerasing.
21+
# Preemptively remove containerd* so docker-ce.repo's version can
22+
# install cleanly.
23+
dnf remove -y containerd containerd.io 2>/dev/null || true
24+
rpm -e --nodeps containerd containerd.io 2>/dev/null || true
25+
yum install -y docker-ce docker-ce-cli containerd.io
2226
systemctl start docker
2327
systemctl enable docker
2428
fi

0 commit comments

Comments
 (0)