docker-ansible
docker-ansible copied to clipboard
Rewrite Dockerfile to use python:3.12 and update to latest ansible (9.6.0)
This pull request updates the Dockerfile to use Python 3.12 and the latest version of Ansible (9.6.0). Key changes include:
- Switching the base image from
python:3.7-alpinetopython:3.12. - Updating package installations to use
apt-getinstead ofapk. - Removing unnecessary build dependencies after installation to reduce image size.
- Updating
requirements.txtto use Ansible 9.6.0.
These changes ensure compatibility with newer Python versions and bring in the latest features and fixes from Ansible.
Changes:
Dockerfile:- Update base image to
python:3.12. - Switch from
apktoapt-getfor package management. - Clean up package installation process.
- Update base image to
requirements.txt:- Update Ansible version to 9.6.0.
Testing:
I confirmed that running ansible command line still works:
docker build . -t gableroux/ansible:9.6.0
docker run --rm -it gableroux/ansible:9.6.0 ansible --version
ansible [core 2.16.7]
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.12.3 (main, May 14 2024, 05:40:55) [GCC 12.2.0] (/usr/local/bin/python)
jinja version = 3.1.4
libyaml = True