Post

Docker ansible

How to build, push, and run a Docker image with Ansible pre-installed for ML infrastructure automation.

These commands log in to Docker Hub, push a custom Ansible image, and then run a container from that image with a local project directory mounted as a volume. This is useful for running Ansible playbooks in a consistent, containerized environment.

1
2
3
4
5
export CI_REGISTRY=docker.io
docker login -u "devopsinuse" -p "..." $CI_REGISTRY
docker push devopsinuse/ansible-ml:v2.9.2

docker run -it -v /home/jantoth/Documents/sbx/ml/k3s:/home/ml-ansible   -w /home/ml-ansible ansible-ml:v2.9.2.1 sh
This post is licensed under CC BY 4.0 by the author.