Files
DevOpsLab/dockerfiles/debian/Dockerfile
Сергей Антропов 1a8e7d6af2 fix: исправление Dockerfiles для Ubuntu и Debian
- Убрана установка yq (проблемы с архитектурой)
- Исправлена установка Docker для правильной архитектуры
- Использование dpkg --print-architecture вместо hardcoded amd64
- Упрощена структура Dockerfiles
- Образы успешно собраны и отправлены в Docker Hub

Исправления:
- Ubuntu 22.04: inecs/ansible-lab:ubuntu-22.04
- Debian bookworm: inecs/ansible-lab:debian-bookworm
2025-10-25 16:47:11 +03:00

57 lines
1.8 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Debian Bookworm с systemd
# Автор: Сергей Антропов
# Сайт: https://devops.org.ru
FROM debian:bookworm
# Обновляем систему
RUN apt-get update && apt-get dist-upgrade -y
# Устанавливаем systemd и необходимые пакеты
RUN apt-get install -y \
systemd \
systemd-sysv \
dbus \
curl \
wget \
git \
vim \
nano \
htop \
tree \
jq \
python3 \
python3-pip \
&& apt-get clean
# Устанавливаем Docker вручную для Debian
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release \
&& mkdir -p /usr/share/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin \
&& apt-get clean
# Устанавливаем Docker Compose
RUN curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose
# Настраиваем systemd
RUN systemctl set-default multi-user.target
# Создаем пользователя для Ansible
RUN useradd -m -s /bin/bash ansible \
&& echo "ansible ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Переключаемся на пользователя ansible
USER ansible
WORKDIR /home/ansible
# Команда по умолчанию
CMD ["/sbin/init"]