gpt4 book ai didi

Docker pihole 设置停止在lighttpd 服务

转载 作者:行者123 更新时间:2023-12-02 06:38:38 25 4
gpt4 key购买 nike

我正在 ubuntu docker 镜像中安装 pihole。但是,安装程序在“重新启动 lig​​httpd 服务”时停止并存在。

这是我的 base.docker 文件:

FROM ubuntu:latest
ENV term=xterm
ENV DEBIAN_FRONTEND=noninteractive

RUN \
apt-get update --fix-missing\
&& apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Pihole commands
RUN mkdir /etc/pihole
COPY pihole/setupVars.conf /etc/pihole
RUN apt-get update && apt-get install -y apt-transport-https
RUN apt-get install -y dialog
RUN apt-get install -y dhcpcd5
RUN apt-get install -y apt-utils
RUN apt install git -y
RUn apt-get install -y iproute2
RUN apt-get install -y whiptail
RUN apt-get install php-sqlite3 -y
RUN apt-get install bc
RUN apt-get --yes --no-install-recommends install netcat idn2 sqlite3 lighttpd php-common php-cgi php-sqlite3
RUN apt-get install dnsutils -y
RUN apt-get install iputils-ping -y
RUN apt-get install -y lsof
RUN apt-get install sudo -y
RUN apt-get install unzip -y
RUN apt-get install -y dns-root-data

RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections

RUN apt install resolvconf -y

#RUN apt-get -y install tzdata
#RUN dpkg --configure -a
#RUN apt-get install -f
#RUN cat /etc/apt/sources.list
#RUN apt-get remove --purge resolvconf
#RUN apt-get --yes --no-install-recommends install resolvconf php-cgi php-sqlite3

RUN apt-get install software-properties-common -y
RUN add-apt-repository universe
RUN sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
RUN curl -L https://install.pi-hole.net | bash /dev/stdin --unattended

我正在从 setupVars.conf 复制 pihole 设置所需的必要参数。文件如下:

PIHOLE_INTERFACE=Enter data here
IPV4_ADDRESS=Enter data here
IPV6_ADDRESS=
PIHOLE_DNS_1=8.8.8.8
PIHOLE_DNS_2=8.8.4.4
QUERY_LOGGING=true
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
LIGHTTPD_ENABLED=true
WEBPASSWORD=Enter password here
BLOCKING_ENABLED=true

但是,安装程序在“重新启动 lig​​htpd 服务”时停止,终端如下所示:

Step 23/51 : RUN apt-get install -y whiptail
---> Using cache
---> d2b7797e4e88
Step 24/51 : RUN apt-get install php-sqlite3 -y
---> Using cache
---> 17743bc99367
Step 25/51 : RUN apt-get install bc
---> Using cache
---> fc220b2ce2d3
Step 26/51 : RUN apt-get --yes --no-install-recommends install netcat idn2 sqlite3 lighttpd php-common php-cgi php-sqlite3
---> Using cache
---> 0173179c6da5
Step 27/51 : RUN apt-get install dnsutils -y
---> Using cache
---> 9aff333b2464
Step 28/51 : RUN apt-get install iputils-ping -y
---> Using cache
---> 71854fdd4929
Step 29/51 : RUN apt-get install -y lsof
---> Using cache
---> a8c2d8bf991b
Step 30/51 : RUN apt-get install sudo -y
---> Using cache
---> d83dc0dd04de
Step 31/51 : RUN apt-get install unzip -y
---> Using cache
---> 8bd66d6f6f59
Step 32/51 : RUN apt-get install -y dns-root-data
---> Using cache
---> 51db506b63de
Step 33/51 : RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
---> Using cache
---> 04823fd87ca9
Step 34/51 : RUN echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections
---> Using cache
---> 31da49abddeb
Step 35/51 : RUN apt install resolvconf -y
---> Using cache
---> 2d20235c3d99
Step 36/51 : RUN apt-get install software-properties-common -y
---> Using cache
---> 3501fe747e84
Step 37/51 : RUN add-apt-repository universe
---> Using cache
---> 148b8f56762a
Step 38/51 : RUN sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
---> Using cache
---> ac2dee94fdfd
Step 39/51 : RUN curl -L https://install.pi-hole.net | bash /dev/stdin --unattended
---> Running in c4b0a7bf1522
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5 100 5 0 0 30 0 --:--:-- --:--:-- --:--:-- 30
100 111k 100 111k 0 0 427k 0 --:--:-- --:--:-- --:--:-- 427k

[✓] Root user check

.;;,.
.ccccc:,.
:cccclll:. ..,,
:ccccclll. ;ooodc
'ccll:;ll .oooodc
.;cll.;;looo:.
.. ','.
.',,,,,,'.
.',,,,,,,,,,.
.',,,,,,,,,,,,....
....''',,,,,,,'.......
......... .... .........
.......... ..........
.......... ..........
......... .... .........
........,,,,,,,'......
....',,,,,,,,,,,,.
.',,,,,,,,,'.
.',,,,,,'.
..'''.

[i] Existing PHP installation detected : PHP version 7.2.24-0ubuntu0.18.04.1
[i] Performing unattended setup, no whiptail dialogs will be displayed
[✓] Disk space check
[✓] Update local cache of available packages

[✗] Checking apt-get for upgraded packages
Kernel update detected. If the install fails, please reboot and try again
[i] Installer Dependency checks...
[✓] Checking for apt-utils
[✓] Checking for dialog
[✓] Checking for debconf
[✓] Checking for dhcpcd5
[✓] Checking for git
[✓] Checking for iproute2
[✓] Checking for whiptail

[✗] Check for existing repository in /etc/.pihole
[✓] Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole

[✗] Check for existing repository in /var/www/html/admin
[✓] Clone https://github.com/pi-hole/AdminLTE.git into /var/www/html/admin

[i] Main Dependency checks...
[✓] Checking for cron
[✓] Checking for curl
[✓] Checking for dnsutils
[✓] Checking for iputils-ping
[✓] Checking for lsof
[✓] Checking for netcat
[✓] Checking for psmisc
[✓] Checking for sudo
[✓] Checking for unzip
[✓] Checking for wget
[✓] Checking for idn2
[✓] Checking for sqlite3
[✓] Checking for libcap2-bin
[✓] Checking for dns-root-data
[✓] Checking for resolvconf
[✓] Checking for libcap2
[✓] Checking for lighttpd
[✓] Checking for php7.2-common
[✓] Checking for php7.2-cgi
[✓] Checking for php7.2-sqlite3

[✓] Enabling lighttpd service to start on reboot...

[i] FTL Checks...

[✓] Detected x86_64 architecture
[i] Checking for existing FTL binary...
[✓] Downloading and Installing FTL
[✓] Creating user 'pihole'
[✓] Installing scripts from /etc/.pihole

[i] Installing configs from /etc/.pihole...
[✓] No dnsmasq.conf found... restoring default dnsmasq.conf...
[✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf

[i] Installing blocking page...
[✓] Creating directory for blocking page, and copying files
[✓] Backing up index.lighttpd.html

[✓] Installing sudoer file

[✓] Installing latest Cron script

[✓] Installing latest logrotate script
[i] Backing up /etc/dnsmasq.conf to /etc/dnsmasq.conf.old
[i] man not installed
[i] Testing if systemd-resolved is enabled
[i] Systemd-resolved does not need to be restarted
[i] Restarting lighttpd service...The command '/bin/sh -c curl -L https://install.pi-hole.net | bash /dev/stdin --unattended' returned a non-zero code: 1

我不确定到底是什么导致了这个问题。

如果有人以前遇到过这个问题,有什么想法或建议吗?

谢谢。

最佳答案

Docker 容器中没有服务管理器(如 systemd),因此这可能就是它失败的原因。

为什么不使用官方的 Docker 镜像? https://github.com/pi-hole/docker-pi-hole

关于Docker pihole 设置停止在lighttpd 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59215628/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com