在 Docker 容器中安装 pi-hole

Installing pi-hole in Docker Container

我有一个基于 Ubuntu 的 docker 容器。我正在尝试在其中安装 pi-hole。安装命令在我的base.dockerfile里。命令是: 来自 ubuntu:latest # pi-hole 命令 运行 回声 'debconf debconf/frontend select Noninteractive' | debconf-set-selections 运行 echo -e "\nexport TERM=xterm" >> ~/.bashrc

    RUN apt-get update && apt-get install -y \
        curl \
        && curl -sSL https://install.pi-hole.net | bash

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

但是,我收到以下错误:

从图像中提取的文本:

> Get:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe
> amd64 Packages [4235 B] Fetched 4201 kB in 1s (3770 kB/s) Reading
> package lists... Reading package lists... Building dependency tree...
> Reading state information... curl is already the newest version
> (7.58.0-2ubuntu3.8). 0 upgraded, 0 newly installed, 0 to remove and 38
> not upgraded.
> 
>   [✓] Root user check
> 
>         .;;,.
>         .ccccc:,.
>          :cccclll:.      ..,,
>           :ccccclll.   ;ooodc
>            'ccll:;ll .oooodc
>              .;cll.;;looo:.
>                  .. ','.
>                 .',,,,,,'.
>               .',,,,,,,,,,.
>             .',,,,,,,,,,,,....
>           ....''',,,,,,,'.......
>         .........  ....  .........
>         ..........      ..........
>         ..........      ..........
>         .........  ....  .........
>           ........,,,,,,,'......
>             ....',,,,,,,,,,,,.
>                .',,,,,,,,,'.
>                 .',,,,,,'.
>                   ..'''.
> 
>   [✓] 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...   [i] Checking for
> apt-utils (will be installed)   [i] Checking for dialog (will be
> installed)   [✓] Checking for debconf   [i] Checking for dhcpcd5 (will
> be installed)   [i] Checking for git (will be installed)   [i]
> Checking for iproute2 (will be installed)   [i] Checking for whiptail
> (will be installed) TERM environment variable needs set. The command
> '/bin/sh -c apt-get update && apt-get install -y     curl     && curl
> -sSL https://install.pi-hole.net | bash' returned a non-zero code: 1

我有点困惑,因为我对此很陌生。

如有任何建议或线索,我们将不胜感激。

谢谢。

这是一个typical script error in virtual environments that applies to Docker containers, too. Please try the solutions from this SO question:

其中之一:

  • 运行命令set | grep TERM

  • 运行 export TERM=xterm

  • 运行 export TERM=linux