63 lines
1.8 KiB
Docker
63 lines
1.8 KiB
Docker
# Используем более легкий базовый образ
|
|
FROM python:3.12.9-slim-bullseye
|
|
|
|
# Добавляем метаданные
|
|
LABEL maintainer="Сергей Антропов <sergey@antropoff.ru>"
|
|
LABEL description="Этот Dockerfile создан для внедрения подхода IaC в Ansible."
|
|
LABEL version="0.1"
|
|
LABEL contact.website="https://devops.org.ru"
|
|
|
|
# Устанавливаем переменные окружения
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV EDITOR=nano
|
|
|
|
# Устанавливаем системные зависимости
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
git \
|
|
ssh \
|
|
gcc \
|
|
libffi-dev \
|
|
libssl-dev \
|
|
make \
|
|
sudo \
|
|
sshpass \
|
|
openssh-client \
|
|
nano \
|
|
less \
|
|
ca-certificates \
|
|
curl \
|
|
gnupg \
|
|
diffutils \
|
|
jq \
|
|
lsb-release \
|
|
&& mkdir -p /etc/apt/keyrings \
|
|
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
|
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bullseye stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
|
|
&& apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
docker-ce-cli \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Устанавливаем зависимости Python для Ansible и Molecule
|
|
RUN pip install --upgrade pip && \
|
|
pip install \
|
|
ansible \
|
|
ansible-lint \
|
|
ansible-vault \
|
|
molecule \
|
|
molecule-docker \
|
|
molecule-plugins \
|
|
ansible-compat \
|
|
docker
|
|
|
|
# Копируем ssh ключ
|
|
#COPY id_rsa /root/.ssh/id_rsa
|
|
#RUN chmod 600 /root/.ssh/id_rsa
|
|
|
|
# Устанавливаем рабочую директорию
|
|
WORKDIR /ansible
|
|
|
|
# Команда по умолчанию
|
|
CMD ["/bin/bash"]
|