Skip to content

Commit

Permalink
Fix build for Ubuntu 22.04 CI environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Dec 25, 2022
1 parent 101602c commit 8cd3de2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ jobs:
run: docker build -t docker-ansible .

- name: Run the built image.
run: docker run --name test-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro docker-ansible
run: >-
docker run --name test-container -d --privileged
-v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host
docker-ansible
- name: Verify Ansible is accessible in the built image.
run: docker exec --tty test-container env TERM=xterm ansible --version
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This image is built on Docker Hub automatically any time the upstream OS contain

1. [Install Docker](https://docs.docker.com/engine/installation/).
2. Pull this image from Docker Hub: `docker pull geerlingguy/docker-debian11-ansible:latest` (or use the image you built earlier, e.g. `debian11-ansible`).
3. Run a container from the image: `docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-debian11-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``).
3. Run a container from the image: `docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host geerlingguy/docker-debian11-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``).
4. Use Ansible inside the container:
a. `docker exec --tty [container_id] env TERM=xterm ansible --version`
b. `docker exec --tty [container_id] env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml --syntax-check`
Expand Down

0 comments on commit 8cd3de2

Please sign in to comment.