Open patrickstump opened 2 years ago
+1 on this. Also encountered today and was about to report this
Possible duplicate of #4.
For those with the same issue, this is the solution:
# molecule.yml
# ,,,
platforms:
- name: ubuntu2204
image: geerlingguy/docker-ubuntu2204-ansible:latest
cgroupns_mode: host
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw # won't work with ro
privileged: true
pre_build_image: true
# ...
My understanding is that this removes any isolation from the container and the processes run directly on the host. Obviously an issue in prod, but fine for local dev and automated testing on GitHub Actions.
Overview
This appears to be an issue with default docker settings on ubuntu 22.04 desktop, so I don't think it is an actual issue with the image. However, I wasn't sure where else to put the knowledge. Apologies if this is the wrong call.
Error
When running
molecule test
with thegeerlingguy/docker-ubuntu2204-ansible:latest
image, gather_facts throws the error:As stated clearly in the README for this project, the
cgroupns=host
should be used. Docker says the default cgroupns ishost
, however unless I specified that on the command line, it would not run manually or via molecule.Making modifications to molecule.yml did nothing. Finally I edited /etc/docker/daemon.json to set the default cgroupns for docker to
host
and it started working.Fix
Add `default-cgroupns-mode" to docker's daemon.json file and restart docker.
Alternate Fix
If someone knows how to specify
cgroupns
in the molecule file, I think that would be a better solution. I could not find anyway to do so. Please comment if you know how.Host Machine
Host: Ubuntu 22.04 Desktop, amd64
Docker Version
Molecule Config