Skip to content

Python slim based minimal ansible/ansible-core images with version support

License

Notifications You must be signed in to change notification settings

thehedhly/ansible-docker

Repository files navigation

ansible-docker

Build Docker build

Ansible Logo

Features

  • Builds python based ansible-core and ansible community package docker images.

Ansible:

In accordance with both ansible community projects, ansible community package and ansible-core, this project builds two seperate images as follows:

Ansible project Supported versions DockerHub Image
ansible community package
  • 9.0
  • 10.0
thehedhly/ansible
ansible-core
  • 2.16
  • 2.17
thehedhly/ansible-core

Usage

Format

Build the ansible or ansible-core docker image, run then attach to the container:

docker compose run --build --remove-orphans --rm <ansible|ansible-core>

Build the ansible or ansible-core docker image, run command without attaching to the container:

docker compose run --build --remove-orphans --rm <ansible|ansible-core> <command>

Examples

Build ansible image, run and attach to container

docker compose run --build --remove-orphans --rm ansible

Build ansible-core image, run and attach to container

docker compose run --build --remove-orphans --rm ansible-core

Build ansible image, run 'ansible --version' command without attaching to the container

docker compose run --build --remove-orphans --rm ansible ansible --version

Build ansible-core image, run 'ansible --version' command without attaching to the container

docker compose run --build --remove-orphans --rm ansible-core ansible --version

To use a specefic ansible or ansible-core version, please see docker-compose.yml and list of supported build arguments.

Build arguments

Name description default
BASE_IMAGE Base docker image. python:3.12.7-slim
PYCMD Python binary location.
ℹ️ See also BASE_IMAGE
/usr/local/bin/python3.11
SYS_ZONEINFO System time zone. Europe/Berlin
ANSIBLE_INSTALL_REFS Ansible installation package.
You can install a specific version of a ansible community package or ansible-core, e.g.:
  • ansible-core==2.16.0
  • or
  • ansible==9
ansible-core
ANSIBLE_HOME Ansible home where the build's extra (optional) ansible roles/collections are installed.
See Ansible requirements.yml
/usr/share/ansible
ANSIBLE_GALAXY_CLI_COLLECTION_OPTS Build's CLI options for installing ansible collection.
Check ansible-galaxy cli documentation for more details.
-v
ANSIBLE_GALAXY_CLI_ROLE_OPTS Build's CLI options for installing ansible roles.
Check ansible-galaxy cli documentation for more details.
-v
ANSIBLE_USER User to set for ansible image. A home directory is setup for the provided user. The default ansible configuration file for the user is located in his home driectory. thehedhly

This project was created by H.Hedhly.

About

Python slim based minimal ansible/ansible-core images with version support

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published