Files
Сергей Антропов 9c37bb4ea1 Добавлено примечание о поддержке только AMD64 для Astra Linux
- Astra Linux базовый образ registry.astralinux.ru/library/astra/ubi17:1.7.6.uu2 поддерживает только linux/amd64
- Добавлен комментарий с инструкцией по сборке только для AMD64
2025-10-25 22:58:57 +03:00

71 lines
3.0 KiB
Docker
Raw Permalink 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.

# Astra Linux с systemd
# Автор: Сергей Антропов
# Сайт: https://devops.org.ru
# https://registry.astralinux.ru/browse/library/
# ВАЖНО: Базовый образ поддерживает только linux/amd64
# Для сборки используйте: docker buildx build --platform linux/amd64
FROM registry.astralinux.ru/library/astra/ubi17:1.7.6.uu2
# Обновляем систему
RUN apt-get update && apt-get dist-upgrade -y
# Устанавливаем systemd и необходимые пакеты
RUN apt-get install -y \
systemd \
systemd-sysv \
dbus \
curl \
wget \
nano \
python3 \
python3-pip \
sudo \
&& apt-get clean
# Устанавливаем yq (автоопределение архитектуры)
# RUN ARCH=$(dpkg --print-architecture | sed 's/amd64/amd64/; s/arm64/arm64/; s/aarch64/arm64/') && \
# wget -qO /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${ARCH}" && \
# chmod +x /usr/local/bin/yq
# Устанавливаем Docker вручную для AstraLinux (автоопределение архитектуры)
# RUN ARCH=$(dpkg --print-architecture) && \
# 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=${ARCH} signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian buster 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
# Отключаем Parsec для работы в контейнере
RUN if [ -f /etc/parsec/parsec.conf ]; then \
sed -i 's/enabled=1/enabled=0/' /etc/parsec/parsec.conf || true; \
fi && \
if [ -f /lib/modules/$(uname -r)/parsec.ko ]; then \
mv /lib/modules/$(uname -r)/parsec.ko /lib/modules/$(uname -r)/parsec.ko.disabled || true; \
fi && \
systemctl disable parsec 2>/dev/null || true
# Настраиваем systemd
RUN systemctl set-default multi-user.target
# Настраиваем sudoers для root и пользователей
RUN echo "root ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
echo "ALL ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ansible-test
# Создаем пользователя для Ansible
RUN useradd -m -s /bin/bash ansible \
&& echo "ansible ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Команда по умолчанию (система запускается от root для systemd)
CMD ["/sbin/init"]