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 856a3e8 commit 1a347b6
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 @@ -26,7 +26,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-ubuntu1804-ansible:latest` (or use the image you built earlier, e.g. `ubuntu1804-ansible:latest`).
3. Run a container from the image: `docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-ubuntu1804-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-ubuntu1804-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 1a347b6

Please sign in to comment.