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

Can't start a simple container #1226

Closed urlund closed 1 year ago

urlund commented 1 year ago

:ghost: Brief Description

After upgrading the cookbook I can't start a simple container.

:pancakes: Cookbook version

10.3.0

:woman_cook: Chef-Infra Version

Chef Infra Client, version 18.1.0 (chef-solo)

:tophat: Platform details

Debian GNU/Linux 11 (bullseye)

Steps To Reproduce

Create a cookbook with this in default.rb

docker_container "nginx" do
    action         :run
    repo           "nginx"
    tag            "latest"
end

:police_car: Expected behavior

A running container

:heavy_plus_sign: Additional context (error message)

  * docker_container[nginx] action run

    ================================================================================
    Error executing action `run` on resource 'docker_container[nginx]'
    ================================================================================

    NoMethodError
    -------------
    undefined method `key?' for nil:NilClass

    Cookbook Trace: (most recent call first)
    ----------------------------------------
    /etc/chef/local-mode-cache/cache/cookbooks/docker/resources/container.rb:733:in `cgroupv2?'
    /etc/chef/local-mode-cache/cache/cookbooks/docker/resources/container.rb:535:in `block (3 levels) in class_from_file'
    /etc/chef/local-mode-cache/cache/cookbooks/docker/resources/container.rb:453:in `block (2 levels) in class_from_file'
    /etc/chef/local-mode-cache/cache/cookbooks/docker/resources/container.rb:450:in `block in class_from_file'
    /etc/chef/local-mode-cache/cache/cookbooks/docker/resources/container.rb:709:in `call_action'
    /etc/chef/local-mode-cache/cache/cookbooks/docker/resources/container.rb:442:in `block in class_from_file'