55 lines
1.3 KiB
Docker
55 lines
1.3 KiB
Docker
FROM python:slim
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
software-properties-common \
|
|
openssh-client \
|
|
sshpass \
|
|
locales \
|
|
bash \
|
|
git \
|
|
curl \
|
|
rsync \
|
|
sudo \
|
|
less \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
|
&& rm -Rf /usr/share/doc && rm -Rf /usr/share/man
|
|
|
|
ARG USERNAME=ansible
|
|
ARG USER_UID=1000
|
|
ARG USER_GID=$USER_UID
|
|
ENV HOME=/home/$USERNAME
|
|
RUN groupadd --gid $USER_GID $USERNAME
|
|
RUN useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME
|
|
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL >/etc/sudoers.d/$USERNAME
|
|
RUN chmod 0440 /etc/sudoers.d/$USERNAME
|
|
|
|
RUN pip3 install --no-cache-dir \
|
|
ansible \
|
|
ansible-runner \
|
|
ansible-builder \
|
|
ansible-doctor \
|
|
ansible-later \
|
|
ansible-lint \
|
|
ansible-autodoc
|
|
|
|
ENV ANSIBLE_GATHERING=smart
|
|
ENV ANSIBLE_HOST_KEY_CHECKING=false
|
|
ENV ANSIBLE_RETRY_FILES_ENABLED=false
|
|
ENV ANSIBLE_FORCE_COLOR=true
|
|
ENV GOSS_FMT=documentation
|
|
ENV GOSS_COLOR=true
|
|
|
|
|
|
# Install goss for testing
|
|
RUN curl -L https://github.com/goss-org/goss/releases/latest/download/goss-linux-amd64 -o /usr/local/bin/goss
|
|
RUN chmod +rx /usr/local/bin/goss
|
|
COPY ./goss.yaml ./goss.yaml
|
|
RUN goss validate
|
|
|
|
# Set apt frontend back to dialog for interactive prompts
|
|
ENV DEBIAN_FRONTEND=dialog
|