sous-chefs / docker

Development repository for the docker cookbook
https://supermarket.chef.io/cookbooks/docker
Apache License 2.0
1.35k stars 794 forks source link

PR #1253 is a breaking change. Break on CentOS 7 (Old kernel without cgroup v2) #1254

Closed benoitjpnet closed 7 months ago

benoitjpnet commented 1 year ago

:ghost: Brief Description

PR #1253 made a breaking change. Setting cgroup_ns to a default value of private breaks systems that don't have cgroup2, such as CentOS7.

:pancakes: Cookbook version

11.2.0

:woman_cook: Chef-Infra Version

Cinc Client: 17.10.0

:tophat: Platform details

cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Deploy a container on CentOS7
  2. It fails with Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: cgroup namespaces aren't enabled in the kernel: unknown

:police_car: Expected behavior

The change from #1253 should be marked as a breaking change, or should have some logic to detect if cgroup2 is available. If not, fallback to host instead of private.

:heavy_plus_sign: Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.