0

I am just building a very simple Docker container and, for some reason, the build fails but only when trying to build it inside of a RedHat Linux server. Here's the error that I'm getting:

invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up libdevmapper1.02.1:amd64 (2:1.02.173-1) ...
Setting up libcryptsetup12:amd64 (2:2.3.4-1) ...
Setting up systemd (247.1-3) ...
Traceback (most recent call last):
  File "/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.18.0', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 71, in main
    command()
  File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 124, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3.6/site-packages/compose/cli/main.py", line 254, in build
    build_args=build_args)
  File "/usr/lib/python3.6/site-packages/compose/project.py", line 364, in build
    service.build(no_cache, pull, force_rm, memory, build_args)
  File "/usr/lib/python3.6/site-packages/compose/service.py", line 972, in build
    all_events = stream_output(build_output, sys.stdout)
  File "/usr/lib/python3.6/site-packages/compose/progress_stream.py", line 23, in stream_output
    print_output_event(event, stream, is_terminal)
  File "/usr/lib/python3.6/site-packages/compose/progress_stream.py", line 90, in print_output_event
    stream.write("%s%s" % (event['stream'], terminator))
UnicodeEncodeError: 'ascii' codec can't encode character '\u2192' in position 74: ordinal not in range(128)

and here's my Dockerfile:

FROM kalilinux/kali-rolling

# Set environment variable for non-interactive install
ARG DEBIAN_FRONTEND=noninteractive

# Run basic commands to update the image
RUN apt update && \
    apt dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" && \
    apt autoremove -y && \
    apt clean -y && \
    apt install -yqq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
    dnsutils \
    gobuster \
    iputils-ping \
    kali-linux-default \
    lftp \
    ntpdate \
    parallel && \
    echo "syntax on" >> ~/.vimrc && \
    echo "set tabstop=2" >> ~/.vimrc && \
    echo "set shiftwidth=2" >> ~/.vimrc && \
    echo "set expandtab" >> ~/.vimrc && \
    echo "set nu!" >> ~/.vimrc && \
    echo "set smartindent" >> ~/.vimrc

Is the problem in my Dockerfile or is there actually something wrong with one of the tools that the image is running into when installing it?

LewlSauce
  • 5,326
  • 8
  • 44
  • 91
  • Possibly related: https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20 – Turing85 Dec 20 '20 at 00:35
  • [u2192 - Unicode Character 'RIGHTWARDS ARROW'](https://www.fileformat.info/info/unicode/char/2192/index.htm) Maybe you have this char in some file and you could remove/replace it. Other idea is that system uses ASCII in console and you would have configure `UTF-8` for system. ie. evironment variable - `LANG=gb_US.UTF-8` and similar – furas Dec 20 '20 at 02:56

0 Answers0