Alpine container with Ansible and Mitogen preinstalled
Awesome benchmark for using Ansible with Mitogen
Based on my alpine-ansible-py3 docker image
$ git clone https://github.com/joxz/alpine-ansible-mitogen.git && cd alpine-ansible-mitogen
$ make build
The image will be tagged with the short hash from the latest git commit, e.g. jones2748/alpine-ansible-mitogen:7e4e631
$ docker pull jones2748/alpine-ansible-mitogen:latest
Docker Hub images will be tagged as jones2748/alpine-ansible-mitogen:latest
and/or with git tags, e.g. jones2748/alpine-ansible-mitogen:v0.2
Run a playbook inside the container:
$ docker run -it --rm \
-v ${PWD}:/ansible \
jones2748/alpine-ansible-mitogen:latest \
ansible-playbook -i inventory playbook.yml
make test
executes both tests listed below
$ docker run -it --rm alpine-ansible-mitogen:latest version
ansible 2.7.7
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Jan 24 2019, 16:36:30) [GCC 8.2.0]
$ docker run -it --rm alpine-ansible-mitogent:latest setup
localhost | SUCCESS => {
"ansible_facts": {
"ansible_all_ipv4_addresses": [],
"ansible_all_ipv6_addresses": [],
"ansible_apparmor": {
"status": "disabled"
},
"ansible_architecture": "x86_64",
...
Shell access as user ansible
$ docker run -it --rm alpine-ansible-mitogen:latest
/ansible $ whoami
ansible
Shell access as user root
$ docker run -it --rm alpine-ansible-mitogen:latest makemeroot
/ansible # whoami
root
Makefile included for build, run, test, clean,...
$ make
build build container
build-no-cache build container without cache
clean remove images
help this help
history show docker history for container
inspect inspect container properties - pretty: 'make inspect | jq .' requires jq
logs show docker logs for container (ONLY possible while container is running)
run run container
test test container with builtin tests