# The default ubuntu image dosn't have python3 installed.
# Ansible requires the target host to have python3 installed.
# Therefore, we build a dedicated container image for test purpose.

FROM ubuntu:26.04

# Prevent interactive prompts during build.
ENV DEBIAN_FRONTEND="noninteractive"

# Update package index and install Python.
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    python3 python3-cryptography \
    systemd systemd-sysv dbus && \
    rm -rf /var/lib/apt/lists/*

# These containers run in privileged mode (required by systemd), which gives
# them access to host /dev/tty* devices. By default, systemd spawns
# getty@.service instances that claim those TTYs, which can displace the host's
# graphical session (Wayland). Masking these services prevents that.
RUN systemctl mask \
    getty@.service \
    console-getty.service \
    container-getty@.service \
    systemd-logind.service
