Files
DevOpsLab/dockerfiles/ubuntu/Dockerfile
Сергей Антропов 7924691d34
Some checks failed
Ansible Testing / lint (push) Has been cancelled
Ansible Testing / test (default) (push) Has been cancelled
Ansible Testing / test (minimal) (push) Has been cancelled
Ansible Testing / test (performance) (push) Has been cancelled
Ansible Testing / deploy-check (push) Has been cancelled
Оптимизация Dockerfile: убраны лишние пакеты и закомментированы Docker/yq
- Убраны пакеты: vim, jq, git, htop, tree из всех Dockerfile
- Закомментированы установки Docker, Docker Compose, yq
- Обновлен Rocky Linux до версии 9 с Python 3
- Исправлена проблема с passlib в ansible-controller
- Оставлены только необходимые пакеты: systemd, curl, wget, nano, python3, sudo
2025-10-25 22:31:41 +03:00

53 lines
1.9 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.

# Ubuntu 22.04 с systemd
# Автор: Сергей Антропов
# Сайт: https://devops.org.ru
FROM ubuntu:22.04
# Обновляем систему
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
# Устанавливаем Docker вручную для Ubuntu
# 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/ubuntu/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/ubuntu jammy 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)
CMD ["/sbin/init"]