2

I'm having trouble following this guide on Ubuntu 18.04 when working with a specific repository (if anyone would like to follow along, the repo is here). When I try to follow this step:

Select Remote-Containers: Open Folder in Container... from the command list that appears, and open the root folder of the project you just cloned.

I run into an issue where Visual Studio code asks me to "Select the keyboard layout for this machine." As follows:

...
[62625 ms] Setting up netbase (5.4) ...
[62645 ms] Setting up libwebp6:amd64 (0.5.2-1) ...
[62654 ms] Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-5) ...
[62664 ms] Setting up libdb-dev:amd64 (5.3.1) ...
[62673 ms] Setting up libjsoncpp1:amd64 (1.7.4-3) ...
[62682 ms] Setting up libvorbisfile3:amd64 (1.3.5-4+deb9u2) ...
[62691 ms] Setting up libedit2:amd64 (3.1-20160903-3) ...
[62701 ms] Setting up libgmp-dev:amd64 (2:6.1.2+dfsg-1) ...
[62710 ms] Setting up libx265-95:amd64 (2.1-2+b2) ...
[62719 ms] Setting up keyboard-configuration (1.164) ...
[62790 ms] debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
[63090 ms] Configuring keyboard-configuration
----------------------------------

Please select the layout matching the keyboard for this machine.

[63090 ms]   1. English (US)
  2. English (US) - Cherokee
  3. English (US) - English (Colemak)
  4. English (US) - English (Dvorak alternative international no dead keys)
  5. English (US) - English (Dvorak)
[63091 ms]   6. English (US) - English (Dvorak, international with dead keys)
[63091 ms]   7. English (US) - English (Macintosh)
  8. English (US) - English (Programmer Dvorak)
[63091 ms]   9. English (US) - English (US, alternative international)
  10. English (US) - English (US, international with dead keys)
  11. English (US) - English (US, with euro on 5)
[63091 ms]   12. English (US) - English (Workman)
  13. English (US) - English (Workman, international with dead keys)
[63091 ms]   14. English (US) - English (classic Dvorak)
[63091 ms]   15. English (US) - English (international AltGr dead keys)
[63091 ms]   16. English (US) - English (left handed Dvorak)
[63091 ms]   17. English (US) - English (right handed Dvorak)
  18. English (US) - English (the divide/multiply keys toggle the layout)
  19. English (US) - Russian (US, phonetic)
  20. English (US) - Serbo-Croatian (US)
[63091 ms]   21. Other
[63092 ms] Keyboard layout: 

But I'm unable to actually type in the terminal in VS Code to choose a keyboard? I've found a couple other responses to this here where you can do something like this inside the dockerfile: DEBIAN_FRONTEND=noninteractive apt-get install keyboard-configuration But that doesn't seem to solve the issue either. I've tried this entire process on a Macbook just to make sure it's not just me and it gets past this step just fine, which makes me think it's an Ubuntu-related problem (or at least vs code on ubuntu problem) but I'm at a bit of a loss on how to get past this.

You can see the dockerfile here (if it helps):

FROM debian:stretch-slim

#
# avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

ARG USERNAME=neko
ARG USER_UID=1000
ARG USER_GID=$USER_UID

#
# install neko dependencies
RUN set -eux; apt-get update; \
    apt-get install -y --no-install-recommends wget ca-certificates pulseaudio openbox dbus-x11 xserver-xorg-video-dummy supervisor; \
    apt-get install -y --no-install-recommends libcairo2 libxcb1 libxrandr2 libxv1 libopus0 libvpx4; \
    #
    # create a non-root user
    groupadd --gid $USER_GID $USERNAME; \
    useradd --uid $USER_UID --gid $USERNAME --shell /bin/bash --create-home $USERNAME; \
    adduser $USERNAME audio; \
    adduser $USERNAME video; \
    adduser $USERNAME pulse; \
    #
    # setup pulseaudio
    mkdir -p /home/$USERNAME/.config/pulse/; \
    echo "default-server=unix:/tmp/pulseaudio.socket" > /home/$USERNAME/.config/pulse/client.conf; \
    #
    # workaround for an X11 problem: http://blog.tigerteufel.de/?p=476
    mkdir /tmp/.X11-unix; chmod 1777 /tmp/.X11-unix; chown $USERNAME /tmp/.X11-unix/; \
    #
    # make directories for neko
    mkdir -p /etc/neko /var/www /var/log/neko; chmod 1777 /var/log/neko; chown $USERNAME /var/log/neko/;  \
    chown -R $USERNAME:$USERNAME /home/$USERNAME; \
    #
    # clean up
    apt-get clean -y; \
    rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#
# add gst to env
ENV PATH=/gst/local/bin:$PATH
ENV LD_LIBRARY_PATH=/gst/local/lib:$LD_LIBRARY_PATH
ENV PKG_CONFIG_PATH=/gst/local/lib/pkgconfig:$PKG_CONFIG_PATH

#
# copy gst
COPY .build/gst/local /gst/local/

#
# env
ENV USER=$USERNAME
ENV DISPLAY=:99.0

#
# copy configuation files
COPY .docker/files/dbus /usr/bin/dbus
COPY .docker/files/openbox.xml /etc/neko/openbox.xml
COPY .docker/files/neko/supervisord.conf /etc/neko/supervisord/neko.conf
COPY .docker/files/supervisord.conf /etc/neko/supervisord.conf
COPY .docker/files/xorg.conf /etc/neko/xorg.conf
COPY .docker/files/default.pa /etc/pulse/default.pa

#
# neko files
COPY client/dist/ /var/www
COPY server/bin/neko /usr/bin/neko

#
# neko env
ENV NEKO_PASSWORD=neko
ENV NEKO_ADMIN=admin
ENV NEKO_BIND=:8080

#
# run neko
CMD ["/usr/bin/supervisord", "-c", "/etc/neko/supervisord.conf"]
1

Add to RUN /usr/sbin/dpkg-reconfigure keyboard-configuration or /usr/bin/apt-get install -y --reinstall keyboard-configuration

localectl set-keymap en_US.UTF-8
systemctl restart keyboard-setup.service

Try removing ENV DEBIAN_FRONTEND=noninteractive and you should be able to enter input.

Maybe consider localectl set-keymap en_US.UTF-8 and systemctl restart keyboard-setup.service

1
  • Not sure if this is intentional but I think your formatting got messed up in your answer? – secondubly Apr 10 '20 at 23:19
0

You can prepare your configuration file and move it to container like this (execute before the installation)

COPY ./keyboard /etc/default/keyboard

The configuration file looks like this:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

Its an older one but I believe it will work for you. For detail, you can see here about Baseimage-docker

2
  • I'm probably misunderstanding how this works (I'm fairly new to docker and all) but I'm not supposed to put COPY ./keyboard /etc/default/keyboard within the Dockerfile correct? I put it at the top of the Dockerfile and tried running in vs code as per the given steps but still get the same error. – secondubly Apr 10 '20 at 23:19
  • You might be able to get some more info with docker logs -f container-name – ThankYee Apr 13 '20 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.