Closed mwatz1234 closed 2 years ago
I would check if there is a following log entry while building the image:
Created crontab (/etc/cron.d/pihole-updatelists)
It should be at the bash /dev/stdin docker
step.
I've updated main Dockerfile to install wget as well.
Here is the log file section of of building the image. I see it creating the cron tab.
2022-05-30T17:10:05.2748957Z #29 [linux/arm64 5/6] RUN wget -O - https://raw.githubusercontent.com/jacklul/pihole-updatelists/master/install.sh | sudo bash /dev/stdin docker
2022-05-30T17:10:05.2749667Z #0 0.257 --2022-05-30 17:10:04-- https://raw.githubusercontent.com/jacklul/pihole-updatelists/master/install.sh
2022-05-30T17:10:05.2750332Z #0 0.424 Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ...
2022-05-30T17:10:05.2751065Z #0 0.456 Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
2022-05-30T17:10:05.2751464Z #0 0.558 HTTP request sent, awaiting response... 200 OK
2022-05-30T17:10:05.2751744Z #0 0.570 Length: 7624 (7.4K) [text/plain]
2022-05-30T17:10:05.2752069Z #0 0.573 Saving to: 'STDOUT'
2022-05-30T17:10:05.2752288Z #0 0.576
2022-05-30T17:10:05.2752533Z #0 0.576 0K ....... 100% 1.63M=0.004s
2022-05-30T17:10:05.2752772Z #0 0.590
2022-05-30T17:10:05.2753113Z #0 0.591 2022-05-30 17:10:05 (1.63 MB/s) - written to stdout [7624/7624]
2022-05-30T17:10:05.2753465Z #0 0.591
2022-05-30T17:10:06.1078293Z #29 1.507 2022-05-30 17:10:06 URL:https://raw.githubusercontent.com/jacklul/pihole-updatelists/master/pihole-updatelists.php [92718/92718] -> "/usr/local/sbin/pihole-updatelists" [1]
2022-05-30T17:10:06.2581472Z #29 1.550 mode of '/usr/local/sbin/pihole-updatelists' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)
2022-05-30T17:10:06.5585518Z #29 1.895 2022-05-30 17:10:06 URL:https://raw.githubusercontent.com/jacklul/pihole-updatelists/master/pihole-updatelists.conf [669/669] -> "/etc/pihole-updatelists.conf" [1]
2022-05-30T17:10:06.8278537Z #29 2.227 2022-05-30 17:10:06 URL:https://raw.githubusercontent.com/jacklul/pihole-updatelists/master/pihole-updatelists.bash [1152/1152] -> "/etc/bash_completion.d/pihole-updatelists" [1]
2022-05-30T17:10:06.9373727Z #29 2.295 Created crontab (/etc/cron.d/pihole-updatelists)
2022-05-30T17:10:06.9374223Z #29 2.336 mkdir: created directory '/etc/pihole-updatelists'
2022-05-30T17:10:07.0883721Z #29 2.342 Installed container startup script (/etc/cont-init.d/30-pihole-updatelists.sh)
2022-05-30T17:10:07.0884101Z #29 DONE 2.4s
It looks like it should be there, does /etc/cron.d/
even exist in the container?
Since the container stopped, had to look into how to navigate the file system of a stopped container.
I only see one file listed in the /etc/cron.d/ folder
gravity-on-boot
It seems like this is an issue with testdasi/pihole-dot-doh
image directly (it uses testdasi/pihole-base-plus
as a base instead of pihole/pihole
) and that's where the issue might be.
I just checked and sample Dockerfile from this repository builds and starts image correctly.
I can use the testdasi/pihole-dot-doh image and that image starts correctly, I forked that repo and modified the docker file. I am not sure if the issue is becuase its nested docker files to pihole/pihole. As testdasi/pihole-base-plus uses pihole/pihole:latest and my fork version is using base-plus.
Maybe testdasi/pihole-dot-doh
is removing /etc/cron.d/pihole*
files in startup script or something?
There isn't much I can do here since the install log you posted shows correct install and that the file was created.
So I gave up on trying to get pihole, doh, dot, and updlists in one docker. I tried to use your image, and it fails with the same error (i deleted everything in the 'etc' folder so nothing should interfere. This is running on a raspbery pi the latest bullseye 64bit.
The error section: pihole | [cont-init.d] 20-start.sh: exited 0. pihole | [cont-init.d] 30-pihole-updatelists.sh: executing... pihole | copied '/etc/pihole-updatelists.conf' -> '/etc/pihole-updatelists/pihole-updatelists.conf' pihole | removed '/etc/pihole-updatelists.conf' pihole | '/etc/pihole-updatelists.conf' -> '/etc/pihole-updatelists/pihole-updatelists.conf' pihole | mv: cannot stat '/etc/cron.d/pihole-updatelists': No such file or directory pihole | [cont-init.d] 30-pihole-updatelists.sh: exited 1. pihole | [cont-finish.d] executing container finish scripts... pihole | [cont-finish.d] done. pihole | [s6-finish] waiting for services. pihole | [s6-finish] sending all processes the TERM signal. pihole | [s6-finish] sending all processes the KILL signal and exiting. pihole exited with code 1
my docker compose file contains the following
version: '3.0'
services:
pihole:
container_name: pihole
image: jacklul/pihole:latest
hostname: pihole
domainname: pihole.local
ports:
- "443:443/tcp"
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
environment:
- FTLCONF_REPLY_ADDR4=192.168.2.19
- TZ=America/Los_Angeles
- WEBTHEME=lcars
- REV_SERVER=true
- REV_SERVER_TARGET=192.168.2.1
- REV_SERVER_DOMAIN=localdomain
- REV_SERVER_CIDR=192.168.2.0/24
- DNSSEC="true"
volumes:
- './etc/pihole:/etc/pihole:rw'
- './etc/dnsmask:/etc/dnsmasq.d:rw'
- './etc/cron:/etc/cron.d:rw'
- './etc/updatelists:/etc/pihole-updatelists:rw'
restart: unless-stopped
You're mounting a volume for /etc/cron.d/
, this is where the issue is - it does not merge the mount with existing files in the image - it overrides them.
If you want to keep the mount you will have to copy contents of that directory (/etc/cron.d/
in the image) from the image into your mount directory (/etc/cron
) - but I'm not 100% sure if this is gonna work at all.
That was it, able to use the merged docker file as well (pihole, doh, dot, and updatelists) as well. Thanks again for all the help.
background: My goal is to combine pihole-updatelists and testdasi/pihole-dot-doh. I forked over pihole-dot-doh to create a custom Dockerfile and added the lines to needed. RUN apt-get update && apt-get install -Vy php-cli php-sqlite3 php-intl php-curl wget RUN wget -O - https://raw.githubusercontent.com/jacklul/pihole-updatelists/master/install.sh | bash /dev/stdin docker
When I run docker compose it fails with an error that looks like pihole-updatelists cron job never got created. pihole | '/etc/pihole-updatelists.conf' -> '/etc/pihole-updatelists/pihole-updatelists.conf' pihole | mv: cannot stat '/etc/cron.d/pihole-updatelists': No such file or directory pihole | [cont-init.d] 30-pihole-updatelists.sh: exited 1.
Is there a better way to see where the issue is? Or I am creating the custom docker incorrectly? BTW, i had to add installing wget, as the wget command to get the install file fails as wget isnt installed
Longer Log below