docker icon indicating copy to clipboard operation
docker copied to clipboard

Add Rocky Linux and AlmaLinux support

Open Copilot opened this issue 2 months ago • 11 comments

Changes Made

This PR adds support for Rocky Linux and AlmaLinux distributions to the Docker cookbook.

Code Changes

  • resources/installation_package.rb: Added explicit platform detection for Rocky Linux and AlmaLinux to map them to CentOS repositories (Docker provides CentOS repos that work with these RHEL-compatible distributions)
  • spec/docker_test/installation_package_spec.rb: Added comprehensive unit tests for Rocky Linux 8/9 and AlmaLinux 8/9
  • metadata.rb: Added Rocky Linux and AlmaLinux to supported platforms
  • README.md: Updated Platform Support section to list Rocky Linux 8/9 and AlmaLinux 8/9
  • .github/workflows/ci.yml: Added Rocky Linux 8/9/10 to integration test matrix and Rocky Linux 8/9 to smoke test matrix
  • .github/copilot-instructions.md: Updated instructions to reflect that this repository uses release-please for automatic changelog generation (do not manually update CHANGELOG.md)
  • .markdownlint-cli2.yaml and .mdlrc: Disabled MD004 (ul-style) and MD012 (no-multiple-blanks) rules to allow flexible markdown formatting

Technical Details

Rocky Linux and AlmaLinux are binary-compatible successors to CentOS. The implementation adds explicit platform detection that maps these platforms to use 'centos' in the Docker repository URL:

elsif platform?('rocky', 'almalinux')
  'centos'

This ensures compatibility since Docker doesn't provide Rocky/Alma-specific repositories.

Testing

  • ✅ All unit tests pass (280+ examples, 0 failures)
  • ✅ Cookstyle linting passes
  • ✅ yamllint passes
  • ✅ Security scan (CodeQL) completed - no issues found
  • ✅ CI test matrices updated to include Rocky Linux platforms
  • ✅ Markdown linting configured to allow flexible list styles and multiple consecutive blank lines

Rocky Linux is intentionally excluded from installation-script tests (as configured in kitchen.yml), matching the AlmaLinux exclusion pattern.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Rocky Linux support</issue_title> <issue_description>### :speaking_head: Foreword

Thank for taking the time to fill this feature request fully. Without it we may not be able to , and the issue may be closed without resolution.

:frowning_person: Problem Statement

When deploying with Rocky Linux, the cookbook fails as the yum platform variable resolves to rocky and docker itself does not have a provision for rocky

:grey_question: Possible Solution

I have tested installing the centos builds and they appear to work as intended as Rocky linux is the successor to CentOS. A simple added if statement that if the :platform resolves to "rocky" replace it with "centos" to complete the yum repo base_url.

:arrow_heading_up: Describe alternatives you've considered

NA

:heavy_plus_sign: Additional context

NA</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes sous-chefs/docker#1325

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot avatar Dec 06 '25 21:12 Copilot

@copilot fix the markdown error

damacus avatar Dec 06 '25 21:12 damacus

@copilot fix the markdown error

Fixed in commit 56ee29e - removed extra blank line in CHANGELOG.md (MD012 violation)

Copilot avatar Dec 06 '25 21:12 Copilot

@copilot add those platforms to ci.yml

damacus avatar Dec 07 '25 04:12 damacus

@copilot add those platforms to ci.yml

Added in commit e66e072:

  • Rocky Linux 8, 9, and 10 to the integration test matrix (installation-package, installation-tarball, install-and-stop suites)
  • Rocky Linux 8 and 9 to the smoke test matrix

Note: Rocky Linux is intentionally excluded from installation-script tests (as configured in kitchen.yml line 35), matching the AlmaLinux exclusion pattern.

Copilot avatar Dec 07 '25 04:12 Copilot

@copilot do not update changelog.md we are using release-plesse, update your copilot instructions for this new rule

Done in commit c2ebdfd:

  • Reverted all CHANGELOG.md changes (removed the "Unreleased" section)
  • Updated .github/copilot-instructions.md to reflect release-please usage:
    • Line 58: Changed from "Always update CHANGELOG.md" to "Do NOT update CHANGELOG.md"
    • Line 62: Changed from "CHANGELOG.md entry for all code changes" to "Do NOT manually update CHANGELOG.md"

Copilot avatar Dec 07 '25 04:12 Copilot

@copilot ignore multiple consecutive blank lines in markdown

damacus avatar Dec 13 '25 02:12 damacus

@copilot ignore multiple consecutive blank lines in markdown

Done in commit 4dca288:

  • Added no-multiple-blanks: false to .markdownlint-cli2.yaml (MD012)
  • Added ~MD012 to .mdlrc

This disables the multiple consecutive blank lines rule in both markdown linter configurations.

Copilot avatar Dec 13 '25 02:12 Copilot

Slowest examples

Top 10 slowest examples (2.13 seconds, 26.48% of total time)
Example Description Time in seconds
spec/docker_test/container_spec.rb:728 docker_test::container runs execute[change_network_mode] 0.41802
spec/docker_test/installation_package_spec.rb:188 docker_test::installation_package Oracle 9: testing default action, default properties is expected to create yum_repository "docker" 0.30631
spec/docker_test/container_spec.rb:952 docker_test::container testing GPU support creates a container with GPU support 0.25159
spec/libraries/container_spec.rb:70 docker_container creates a docker container with default options is expected to create docker_container "hello_world" 0.24681
spec/libraries/container_spec.rb:168 docker_container creates a docker container with healthcheck options is expected to create docker_container "hello_world" 0.19128
spec/docker_test/service_spec.rb:73 docker_test::service creates docker_service[default] 0.1556
spec/docker_test/service_spec.rb:162 docker_test::service containerd does not exist creates docker_service[default] 0.14747
spec/docker_test/installation_package_spec.rb:236 docker_test::installation_package AlmaLinux 8: testing default action, default properties installs docker 0.1442
spec/unit/resources/swarm_join_spec.rb:26 docker_swarm_join when joining a swarm converges successfully 0.13838
spec/docker_test/installation_package_spec.rb:202 docker_test::installation_package Rocky Linux 8: testing default action, default properties installs docker 0.13781

github-actions[bot] avatar Dec 13 '25 03:12 github-actions[bot]

@copilot ignore md004 markdown error

damacus avatar Dec 13 '25 03:12 damacus

@copilot ignore md004 markdown error

Done in commit 15d49bb:

  • Added ul-style: false to .markdownlint-cli2.yaml (MD004)
  • Added ~MD004 to .mdlrc

This disables the unordered list style rule, allowing mixed asterisk/dash list styles in markdown files.

Copilot avatar Dec 13 '25 03:12 Copilot

Slowest examples

Top 10 slowest examples (1.9 seconds, 24.82% of total time)
Example Description Time in seconds
spec/docker_test/container_spec.rb:728 docker_test::container runs execute[change_network_mode] 0.40535
spec/docker_test/installation_package_spec.rb:205 docker_test::installation_package Rocky Linux 8: testing default action, default properties is expected to create yum_repository "docker" 0.29679
spec/docker_test/container_spec.rb:952 docker_test::container testing GPU support creates a container with GPU support 0.27286
spec/docker_test/service_spec.rb:73 docker_test::service creates docker_service[default] 0.14075
spec/libraries/container_spec.rb:168 docker_container creates a docker container with healthcheck options is expected to create docker_container "hello_world" 0.13511
spec/libraries/container_spec.rb:469 docker_container creates a docker container with GPU support configures nvidia GPU support 0.13456
spec/docker_test/service_spec.rb:162 docker_test::service containerd does not exist creates docker_service[default] 0.13086
spec/docker_test/installation_package_spec.rb:13 docker_test::installation_package Ubuntu: testing default action, default properties is expected to add apt_repository "docker" 0.13072
spec/unit/resources/swarm_init_spec.rb:50 docker_swarm_init when swarm is already initialized does not run init command if already in swarm 0.12913
spec/libraries/registry_spec.rb:72 docker_registry logs into a docker registry with host environment variable is expected to login docker_registry "chefspec_custom_registry" 0.12887

github-actions[bot] avatar Dec 13 '25 06:12 github-actions[bot]