This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Add support for cgroupns_mode #166
Merged
zhan9san
merged 1 commit into
ansible-community:main
from
twouters:feature/cgroupns_mode
Sep 2, 2022
Merged
Add support for cgroupns_mode #166
zhan9san
merged 1 commit into
ansible-community:main
from
twouters:feature/cgroupns_mode
Sep 2, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change doesn't seem to be required at all, the provided examples also work without the |
Hi @twouters, I think this PR could be helpful with docker for mac ansible/molecule#3349 |
Could be that this change is still required for mac, as commented above. |
Thank you for contribution. Could you add doc in https://github.com/ansible-community/molecule-docker/blob/main/src/molecule_docker/driver.py#L56? It would be great if you can add some description about this option. |
twouters
force-pushed
the
feature/cgroupns_mode
branch
from
September 2, 2022 07:47
76484e2
to
6a1b49a
Compare
Added some very very brief docs |
ssbarnea
approved these changes
Sep 2, 2022
This fixes systemd support in Debian >=11 containers. Minimal platforms configuration in `molecule.yml`: ``` platforms: - name: instance image: debian:bullseye command: /lib/systemd/systemd privileged: true cgroupns_mode: private ``` Example `Dockerfile.j2`: ``` FROM debian:bullseye ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y python3 sudo bash ca-certificates \ iproute2 python3-apt aptitude RUN apt-get update && apt-get install -y systemd; \ systemctl mask [email protected]; \ systemctl mask systemd-timesyncd.service; RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ /etc/systemd/system/*.wants/* \ /lib/systemd/system/local-fs.target.wants/* \ /lib/systemd/system/sockets.target.wants/*udev* \ /lib/systemd/system/sockets.target.wants/*initctl* \ /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \ /lib/systemd/system/systemd-update-utmp* ```
zhan9san
force-pushed
the
feature/cgroupns_mode
branch
from
September 2, 2022 16:13
a8b8eb7
to
d75c6d8
Compare
Thanks for your work. I tested it on my Mac, and it works like a charm with Related to
The example for ❯ cat molecule/default/molecule.yml
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: geerlingguy/docker-debian11-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
pre_build_image: true
privileged: true
cgroupns_mode: host
provisioner:
name: ansible
verifier:
name: ansible IMPORTANT:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes systemd support in Debian >=11 containers.
Minimal platforms configuration in
molecule.yml
:Example
Dockerfile.j2
: