Skip to content

Commit bb4bd31

Browse files
committed
rpm: add docker-compose-plugin as "recommends" / "requires"
This defines the dependency between the docker cli and compose (as a plugin). RHEL8 and CentOS 8 (and up) support weak dependencies; - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/packaging_and_distributing_software/new-features-in-rhel-8_packaging-and-distributing-software#support-for-weak-dependencies_new-features-in-rhel-8 - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/packaging_and_distributing_software/new-features-in-rhel-8_packaging-and-distributing-software#boolean-dependencies-syntax But CentOS 7 and RHEL 7 do not yet support this, so for those, we use "Requires", using the `%rhel` macro for detection, which also works on CentOS: rpm --eval '%{rhel}' 7 Making the dependency _recommended_ will install it by default, but users _are_ able to opt-out explicitly, using `--setopt=install_weak_deps=False`, for example, to perform a light-weight installation that does not require all features of Docker. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent a6baa8b commit bb4bd31

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

rpm/SPECS/docker-ce-cli.spec

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ Packager: Docker <[email protected]>
1616
# required packages on install
1717
Requires: /bin/sh
1818
Requires: /usr/sbin/groupadd
19+
20+
# CentOS 7 and RHEL 7 do not yet support weak dependencies
21+
#
22+
# Note that we're not using <= 7 here, to account for other RPM distros, such
23+
# as Fedora, which would not have the rhel macro set (so default to 0).
24+
%if 0%{?rhel} == 7
25+
Requires: docker-compose-plugin
26+
%else
27+
Recommends: docker-compose-plugin
28+
%endif
29+
1930
# TODO change once we support scan-plugin on other architectures
2031
%ifarch x86_64
2132
# CentOS 7 and RHEL 7 do not yet support weak dependencies

rpm/SPECS/docker-compose-plugin.spec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ URL: https://github.com/docker/compose/
1212
Vendor: Docker
1313
Packager: Docker <[email protected]>
1414

15+
# CentOS 7 and RHEL 7 do not yet support weak dependencies.
16+
#
17+
# Note that we're not using <= 7 here, to account for other RPM distros, such
18+
# as Fedora, which would not have the rhel macro set (so default to 0).
19+
%if 0%{?rhel} != 7
20+
Enhances: docker-ce-cli
21+
%endif
22+
1523
BuildRequires: bash
1624

1725
%description

0 commit comments

Comments
 (0)