docker-ansible icon indicating copy to clipboard operation
docker-ansible copied to clipboard

Rewrite Dockerfile to use python:3.12 and update to latest ansible (9.6.0)

Open GabLeRoux opened this issue 1 year ago • 0 comments

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-alpine to python:3.12.
  • Updating package installations to use apt-get instead of apk.
  • Removing unnecessary build dependencies after installation to reduce image size.
  • Updating requirements.txt to 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 apk to apt-get for package management.
    • Clean up package installation process.
  • 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

GabLeRoux avatar May 30 '24 14:05 GabLeRoux