0

I have a Ubuntu based docker container. I am trying to install pi-hole in it. The commands for installation are in my base.dockerfile. The commands are: FROM ubuntu:latest # Commands for pi-hole RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections RUN 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/*

However, I am getting the following error: enter image description here

Extracted text from the image:

> 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

I am a bit confused as I am pretty new to this.

Any suggestions or leads are appreciated.

Thanks.

Jishan
  • 1,654
  • 4
  • 28
  • 62

1 Answers1

0

This is a typical script error in virtual environments that applies to Docker containers, too. Please try the solutions from this SO question:

One of these:

  • Run the command set | grep TERM

  • Run export TERM=xterm

  • Run export TERM=linux

schnaader
  • 49,103
  • 10
  • 104
  • 136
  • Seems that you already set `export TERM=xterm` in the dockerfile (second line in the section "Commands for pi-hole"), you can try changing this – schnaader Nov 28 '19 at 15:49
  • I tried but somehow the commands dont work for me. I am not sure what is wrong with the code. – Jishan Nov 28 '19 at 15:54