Thanks to visit codestin.com
Credit goes to github.com

Skip to content

willhallonline/docker-ansible

Repository files navigation

Ansible

Ansible inside Docker for consistent running of ansible inside your local machine or CI/CD system. You can view CHANGELOG to understand what changes have happened to this recently.

Docker Pulls Docker Image Size (tag)

Current Ansible Core Versions

These are the latest Ansible Core versions running within the containers:

Supported tags and respective Dockerfile links

Immutable Images

There are a number of immutable images that are also being collected. To find a specific version of Ansible, look within the Docker Hub Tags. Each of the containers follow a similar pattern: Ansible-version-Base OS version.

Ansible Core (2.16, 2.17, 2.18, 2.19)

This includes:

ARM releases should now be available for each container image! This happened in the migration to GitHub Actions, but I forgot to update this line.

Base Image (↓) \ Ansible Version (→) Dockerfile 2.19 2.18 2.17 2.16
Latest Dockerfile latest
Alpine Dockerfile alpine
Ubuntu Dockerfile ubuntu
Alpine 3.19 Dockerfile 2.19-alpine-3.19 2.18-alpine-3.19 2.17-alpine-3.19 2.16-alpine-3.19
Alpine 3.20 Dockerfile 2.19-alpine-3.20 2.18-alpine-3.20 2.17-alpine-3.20 2.16-alpine-3.20
Alpine 3.21 Dockerfile 2.19-alpine-3.21 2.18-alpine-3.21 2.17-alpine-3.21 2.16-alpine-3.21
Alpine 3.22 Dockerfile 2.19-alpine-3.22 2.18-alpine-3.22 2.17-alpine-3.22 2.16-alpine-3.22
Bookworm (Debian 12) Dockerfile 2.19-debian-bookworm 2.18-debian-bookworm 2.17-debian-bookworm 2.16-debian-bookworm
Bookworm Slim (Debian 12) Dockerfile 2.19-debian-bookworm-slim 2.18-debian-bookworm-slim 2.17-debian-bookworm-slim 2.16-debian-bookworm-slim
Trixie (Debian 13) Dockerfile 2.19-debian-trixie 2.18-debian-trixie 2.17-debian-trixie
Trixie Slim (Debian 13) Dockerfile 2.19-debian-trixie-slim 2.18-debian-trixie-slim 2.17-debian-trixie-slim
Rocky Linux 10 Dockerfile 2.19-rockylinux-10 2.18-rockylinux-10 2.17-rockylinux-10 2.16-rockylinux-10
Ubuntu 22.04 Dockerfile 2.17-ubuntu-22.04 2.16-ubuntu-22.04
Ubuntu 24.04 Dockerfile 2.19-ubuntu-24.04 2.18-ubuntu-24.04 2.17-ubuntu-24.04 2.16-ubuntu-24.04

Older versions (2.9, 2.10, 2.11, 2.12, 2.13, 2.14, 2.15)

OS:

  • Rockylinux 9
  • Debian Bullseye
  • Ubuntu 20.04

Ansible-core:

  • Ansible 2.12: ...
  • Ansible 2.13: 2.13.13
  • Ansible 2.14: 2.14.18
  • Ansible 2.15: 2.15.13

Various older versions are available in the older-releases documentation.

Running

**You will likely need to mount required directories into your container to make it run (or build on top of what is here).

Simple

docker run --rm -it willhallonline/ansible:latest /bin/sh

Mount local directory and ssh key

docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible:latest /bin/sh

Injecting commands

docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible:latest ansible-playbook playbook.yml

Bash Alias

You can put these inside your dotfiles (~/.bashrc or ~/.zshrc to make handy aliases).

alias docker-ansible-cli='docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --workdir=/ansible willhallonline/ansible:latest /bin/sh'
alias docker-ansible-cmd='docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --workdir=/ansible willhallonline/ansible:latest '

use with:

docker-ansible-cli ansible-playbook -u playbook.yml

To accelerate using Mitogen look into Using Mitogen.

Maintainer

About

Ansible inside Docker containers: Alpine, Ubuntu, Rocky Linux & Debian with Ansible 2.19, 2.18, 2.17, 2.16 (older still supported)

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors 18