This setup allows you to build an ansible image based on ubuntu.
It will setup automatically skipping the interactive mode which requires setup of timezone during ansible installation
Feel free to substitute the ENV TZ
with your current timezone
This setup allows you to build an ansible image based on ubuntu.
It will setup automatically skipping the interactive mode which requires setup of timezone during ansible installation
Feel free to substitute the ENV TZ
with your current timezone
version: '3' | |
services: | |
ansible-control: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
container_name: ansible-control | |
volumes: | |
- ./:/ansible | |
command: tail -f /dev/null |
FROM ubuntu:23.10 | |
WORKDIR /ansible | |
ENV TZ=Africa/Nairobi | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ | |
&& apt update -y \ | |
&& apt install -y tzdata software-properties-common \ | |
&& add-apt-repository --yes --update ppa:ansible/ansible \ | |
&& apt install -y software-properties-common \ | |
&& add-apt-repository --yes --update ppa:ansible/ansible \ | |
&& apt install -y ansible |