ansible-archlinux-docker/Dockerfile

43 lines
1.2 KiB
Docker
Raw Normal View History

2023-01-10 16:31:58 +00:00
FROM docker.io/library/archlinux:latest
RUN pacman --sync --sysupgrade --refresh --noconfirm && \
pacman --sync --noconfirm \
base-devel \
libffi \
openssl \
libyaml \
python \
python-setuptools \
python-pip \
python-yaml \
systemd \
sudo \
iproute2 && \
rm --recursive --force /var/lib/apt/lists/* && \
rm --recursive --force /usr/share/doc && \
rm --recursive --force /usr/share/man
# Fix potential UTF-8 errors with ansible-test
RUN locale-gen en_US.UTF-8
# Install Ansible via pip
RUN pip3 install ansible
# COPY initctl_faker .
# RUN chmod +x initctl_faker && \
# rm --recursive --force /sbin/initctl && \
# ln --symbolic /initctl_faker /sbin/initctl
# Install Ansible inventory file
RUN mkdir --parents /etc/ansible
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
# Remove unnecessary getty and udev targets that result in high CPU usage when
# using multiple containers with molecule
# (https://github.com/ansible/molecule/issues/1104)
RUN rm --recursive --force /lib/systemd/system/systemd*udev* && \
rm --recursive --force /lib/systemd/system/getty.target
VOLUME [ "/sys/fs/cgroup", "/tmp", "/run"]
CMD [ "/lib/systemd/systemd" ]