обновлён /admin/config и API для os_registry. - Molecule/раннер: env из конфигурации, ensure roleforge-os (ensure_roleforge_os.yml), os_registry_pull и доработки executors / runner / create.yml. - /admin/os-images: выбор реестра, buildx (в т.ч. split amd64+arm64 + imagetools), опция --no-cache, стрим логов; domain.py: план команд build, ретраи push. - UI: брендинг (app_name, app_tagline) из app_config через get_ui_branding_context; base.xhtml, role-create / role-view, core.js, pages-main, стили. - Dockerfiles: требование Python ≥3.9 (assert), доработки alt9/astra/debian9/ubuntu20 и др.; новые Dockerfile.arm64 для centos7/centos8. - Конфиг: .env.example, config.py, pyproject.toml.
79 lines
3.4 KiB
Docker
79 lines
3.4 KiB
Docker
# Debian 9 Stretch с systemd
|
||
# Автор: Сергей Антропов
|
||
# Сайт: https://devops.org.ru
|
||
|
||
FROM debian:9
|
||
ENV container=docker
|
||
|
||
# Устанавливаем переменные окружения для автоматического ответа на запросы
|
||
ENV DEBIAN_FRONTEND=noninteractive
|
||
ENV TZ=UTC
|
||
|
||
# Настраиваем archive репозитории для Debian 9 (так как основные репозитории больше не поддерживаются)
|
||
RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list && \
|
||
sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list && \
|
||
echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list && \
|
||
echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
|
||
|
||
# Обновляем систему
|
||
RUN apt-get update && apt-get dist-upgrade -y
|
||
|
||
# Устанавливаем systemd и необходимые пакеты
|
||
RUN apt-get install -y \
|
||
systemd \
|
||
systemd-sysv \
|
||
dbus \
|
||
curl \
|
||
wget \
|
||
nano \
|
||
sudo \
|
||
build-essential \
|
||
zlib1g-dev \
|
||
libssl-dev \
|
||
libffi-dev \
|
||
libsqlite3-dev \
|
||
&& apt-get clean
|
||
|
||
# Ansible 2.14+ requires Python 3.9+ on targets — Stretch ships Python 3.5; install CPython 3.11.
|
||
RUN curl -fsSL https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz | tar xz -C /tmp \
|
||
&& cd /tmp/Python-3.11.9 \
|
||
&& ./configure --prefix=/usr/local --with-ensurepip=install \
|
||
&& make -j "$(nproc)" \
|
||
&& make install \
|
||
&& update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.11 1 \
|
||
&& python3 -m pip install --upgrade pip setuptools wheel \
|
||
&& python3 -c "import sys; assert sys.version_info[:2] >= (3, 9), sys.version"
|
||
|
||
# Устанавливаем 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
|
||
|
||
# Настраиваем 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)
|
||
STOPSIGNAL SIGRTMIN+3
|
||
VOLUME ["/sys/fs/cgroup"]
|
||
CMD ["/sbin/init"]
|