Skip to content

Commit 69817b8

Browse files
committed
Fix build for Ubuntu 22.04 CI environment.
1 parent 90a6925 commit 69817b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/build.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ jobs:
2222
run: docker build -t docker-ansible .
2323

2424
- name: Run the built image.
25-
run: docker run --name test-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro docker-ansible
25+
run: >-
26+
docker run --name test-container -d --privileged
27+
-v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host
28+
docker-ansible
2629
2730
- name: Verify Ansible is accessible in the built image.
2831
run: docker exec --tty test-container env TERM=xterm ansible --version

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This image is built on Docker Hub automatically any time the upstream OS contain
2222

2323
1. [Install Docker](https://docs.docker.com/engine/installation/).
2424
2. Pull this image from Docker Hub: `docker pull geerlingguy/docker-ubuntu2004-ansible:latest` (or use the image you built earlier, e.g. `ubuntu2004-ansible:latest`).
25-
3. Run a container from the image: `docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-ubuntu2004-ansible:latest` (to test my Ansible roles, I add in a volume mounted from the current working directory with ``--volume=`pwd`:/etc/ansible/roles/role_under_test:ro``).
25+
3. Run a container from the image: `docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host geerlingguy/docker-ubuntu2004-ansible:latest` (to test my Ansible roles, I add in a volume mounted from the current working directory with ``--volume=`pwd`:/etc/ansible/roles/role_under_test:ro``).
2626
4. Use Ansible inside the container:
2727
a. `docker exec --tty [container_id] env TERM=xterm ansible --version`
2828
b. `docker exec --tty [container_id] env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml --syntax-check`

0 commit comments

Comments
 (0)