hier ein paar Notizen zu meinen bisherigen (vergeblichen) Versuchen debmatic in docker container zu packen:
Vorbedingungen: debmatic verwendet Systemd, daher braucht man das auch im container. Mögliche Base-images sind etwa:
- alehaa: https://github.com/alehaa/docker-debian-systemd,
- jrei: https://github.com/j8r/dockerfiles/tree ... emd/debian
- udev kmod gnupg2 apt-transport-https wget debconf ipcalc net-tools rsync build-essential dkms
Eigentlich wäre der bessere Weg, wenn man alle einzelnen services (evtl. auch Bündel davon) in separate container packt. Oder halt Alternativ statt Docker lieber auf sowas wie podman für Debian wartet. Bei letzterem ist m.E. Systemd gleich mit an Bord.
ACHJA: der Host muss natürlich die Kernel-module installiert haben und das ganze muss dann auch in den container durchgereicht werden. Siehe Dockerfile und docker-compose.yml
Dockerfile:
Code: Alles auswählen
FROM debian:buster
ENV container docker
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive
RUN apt update \
&& apt install -y systemd udev kmod gnupg2 apt-transport-https wget \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9 \
&& bash -c 'echo "deb http://repos.azulsystems.com/debian stable main" > /etc/apt/sources.list.d/zulu.list' \
&& apt update \
&& apt install -y zulu-11 \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN wget -q -O - https://www.debmatic.de/debmatic/public.key | apt-key add - \
&& bash -c 'echo "deb https://www.debmatic.de/debmatic stable main" > /etc/apt/sources.list.d/debmatic.list' \
&& apt update \
&& apt install -y debconf ipcalc net-tools rsync build-essential dkms \
&& RUNLEVEL=1 apt install -y lighttpd \
# && RUNLEVEL=1 apt install -y pivccu-modules-dkms \
# && RUNLEVEL=1 apt install -y debmatic \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/local-fs.target.wants/* \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \
/lib/systemd/system/systemd-update-utmp*
STOPSIGNAL SIGRTMIN+3
VOLUME [ "/sys/fs/cgroup", "/run", "/run/lock", "/tmp" ]
CMD ["/lib/systemd/systemd"]
docker-compose.yml:
Code: Alles auswählen
version: '3.6'
services:
debmatic:
build:
context: .
args:
VERSION: 0.1
image: ptweety/debmatic
container_name: debmatic
restart: unless-stopped
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
tmpfs:
- /run
- /run/lock
- /tmp
devices:
- "/dev/raw-uart:/dev/raw-uart:rwm"
- "/dev/eq3loop:/dev/eq3loop:rwm"
- "/dev/gpiochip0:/dev/gpiochip0:rwm"
# sysctls:
# - kernel.sched_rt_runtime_us=-1
stop_signal: SIGRTMIN+3
privileged: true
cap_add:
- SYS_ADMIN
# environment:
#USER_ID: 9001
#GROUP_ID: 9001
ports:
- "8081:80"
- "1999:1999"
- "2000:2000"
- "2001:2001"
- "2010:2010"
- "8181:8181"
- "9292:9292"