FROM debian:bookworm

ARG USERNAME=molecule
ARG USERID=1000
ARG GROUPID=1000

RUN apt update && apt install -y iproute2 nftables iptables sudo python3
RUN groupadd --gid ${GROUPID} ${USERNAME}
RUN useradd --comment "molecule account" --gid ${GROUPID} --uid ${USERID} -p ${USERNAME} -G ${USERNAME} -s /usr/bin/bash -m ${USERNAME}

# Allow user to perform sudo actions with no password
RUN echo "%${USERNAME}   ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

COPY files/systemctl3.py /usr/bin/systemctl
RUN chmod +x /usr/bin/systemctl

USER molecule
