summaryrefslogtreecommitdiffstats
path: root/molecule/proxmox/Dockerfile.j2
blob: 4c3cc008b15ae94fb35cfbff5e8f058de1f70d51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Based on the amazing work of geerlingguy <3
# FROM docker.io/geerlingguy/docker-debian12-ansible
FROM docker.io/library/debian:12.12

ARG DEBIAN_FRONTEND=noninteractive

ENV container docker

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        systemd python3 avahi-daemon dhcpcd iproute2 ifupdown udev curl ca-certificates \
    && curl -fsSL https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg \
        -o /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg \
    && echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" \
        > /etc/apt/sources.list.d/pve-no-subscription.list \
    && rm -Rf /var/lib/apt/lists/* \
    && rm -Rf /usr/share/doc \
    && rm -Rf /usr/share/man \
    && apt-get clean

RUN rm -f /lib/systemd/system/multi-user.target.wants/getty.target

# Mimic Debian OS default boot (for testing)
RUN systemctl enable avahi-daemon \
    && touch /etc/locale.gen

# dhcpcd never gets a real lease on podman's virtual network (no DHCP
# server to answer it) and clobbers /etc/resolv.conf with an empty file,
# breaking DNS for later apt-get tasks. Mask it here; the network role
# still purges the dhcpcd package itself later as part of its real logic.
RUN systemctl mask dhcpcd.service

VOLUME ["/sys/fs/cgroup", "/tmp", "/run", "/opt"]

CMD ["/lib/systemd/systemd"]