chriscrowe / docker-pihole-unbound

Run Pi-Hole + Unbound on Docker
1.08k stars 286 forks source link

Container infinite restart loop/crash when building the image with `podman build` #211

Open Lacedaemon opened 1 year ago

Lacedaemon commented 1 year ago

The following error is spammed over and over when using podman-compose with a docker-compose.yaml on custom image built with podman build:

S6-overlay-suexec: fatal: can only run as pid 1

The solve was adding the following to docker-compose.yaml before running podman-compose:

services:
  pihole:
    [...]
    entrypoint: ["/bin/bash", "-c", "./s6-init"]
    [...]

Found this out when looking at the entrypoints displayed for each image in Cockpit. /bin/sh was used in the podman build image, while /bin/bash was used for the original image.

Hopefully this saves someone some time. If anyone has a better way of doing this, please share!

arielnmz commented 9 months ago

I was also able to solve this by commenting out the ENTRYPOINT at the end of the Dockerfile from the 1-container solution:

ARG PIHOLE_VERSION
FROM pihole/pihole:latest
RUN apt update && apt install -y unbound

COPY lighttpd-external.conf /etc/lighttpd/external.conf
COPY unbound-pihole.conf /etc/unbound/unbound.conf.d/pi-hole.conf
COPY 99-edns.conf /etc/dnsmasq.d/99-edns.conf
RUN mkdir -p /etc/services.d/unbound
COPY unbound-run /etc/services.d/unbound/run

# ENTRYPOINT ./s6-init