Skip to content

Commit 06d64a2

Browse files
committed
Fixed systemd container cant run on cgroup v2 host
1 parent 67e3cf0 commit 06d64a2

File tree

8 files changed

+29
-36
lines changed

8 files changed

+29
-36
lines changed

.github/workflows/test-molecule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defaults:
1010
working-directory: 'ansible-role-docker'
1111
jobs:
1212
build:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-20.04
1414
strategy:
1515
fail-fast: false
1616
max-parallel: 4

molecule/centos7/molecule.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ platforms:
1616
pre_build_image: false
1717
privileged: true
1818
command: /usr/sbin/init
19-
# tmpfs:
20-
# - /run
21-
# - /tmp
22-
volumes:
23-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
19+
tmpfs:
20+
- /run
21+
- /run/lock
22+
- /sys/fs/cgroup
2423
provisioner:
2524
name: ansible
2625
playbooks:

molecule/centos8/molecule.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ platforms:
1616
pre_build_image: false
1717
privileged: true
1818
command: /usr/sbin/init
19-
# tmpfs:
20-
# - /run
21-
# - /tmp
22-
volumes:
23-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
19+
tmpfs:
20+
- /run
21+
- /run/lock
22+
- /sys/fs/cgroup
2423
provisioner:
2524
name: ansible
2625
playbooks:

molecule/debian10/molecule.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ platforms:
1515
image: jrei/systemd-debian:10
1616
privileged: true
1717
command: /lib/systemd/systemd
18-
# tmpfs:
19-
# - /run
20-
# - /tmp
21-
volumes:
22-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
18+
tmpfs:
19+
- /run
20+
- /run/lock
21+
- /sys/fs/cgroup
2322
provisioner:
2423
name: ansible
2524
playbooks:

molecule/debian9/molecule.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ platforms:
1616
pre_build_image: false
1717
privileged: true
1818
command: /lib/systemd/systemd
19-
# tmpfs:
20-
# - /run
21-
# - /tmp
22-
volumes:
23-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
19+
tmpfs:
20+
- /run
21+
- /run/lock
22+
- /sys/fs/cgroup
2423
provisioner:
2524
name: ansible
2625
playbooks:

molecule/ubuntu1604/molecule.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ platforms:
1515
image: jrei/systemd-ubuntu:16.04
1616
privileged: true
1717
command: /lib/systemd/systemd
18-
# tmpfs:
19-
# - /run
20-
# - /tmp
21-
volumes:
22-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
18+
tmpfs:
19+
- /run
20+
- /run/lock
21+
- /sys/fs/cgroup
2322
provisioner:
2423
name: ansible
2524
playbooks:

molecule/ubuntu1804/molecule.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ platforms:
1515
image: jrei/systemd-ubuntu:18.04
1616
privileged: true
1717
command: /lib/systemd/systemd
18-
# tmpfs:
19-
# - /run
20-
# - /tmp
21-
volumes:
22-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
18+
tmpfs:
19+
- /run
20+
- /run/lock
21+
- /sys/fs/cgroup
2322
provisioner:
2423
name: ansible
2524
playbooks:

molecule/ubuntu2004/molecule.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ platforms:
1515
image: jrei/systemd-ubuntu:20.04
1616
privileged: true
1717
command: /lib/systemd/systemd
18-
# tmpfs:
19-
# - /run
20-
# - /tmp
21-
volumes:
22-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
18+
tmpfs:
19+
- /run
20+
- /run/lock
21+
- /sys/fs/cgroup
2322
provisioner:
2423
name: ansible
2524
playbooks:

0 commit comments

Comments
 (0)