Files
DevOpsLab/Dockerfile

60 lines
1.5 KiB
Docker

# Use the official Python 3.12.9 Bullseye image as the base
FROM python:3.12.9-bullseye
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV EDITOR=nano
# Install system dependencies
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 \
&& rm -rf /var/lib/apt/lists/*
# Install Docker CLI
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
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/*
# Install Python dependencies for Ansible and 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
# Set the working directory
WORKDIR /ansible
# Default command
CMD ["/bin/bash"]