2016-07-02 67 views
10

Ho la seguente Dockerfile:installazione di `lightdm` in Dockerfile solleva tastiera interattiva menu Layout

# Pull from CentOS RPM Build Image 
FROM ubuntu 

# Update the image 
RUN apt-get update -y 
RUN apt-get install lightdm -y 

Il problema che ho è quando sto costruendo questo contenitore con docker build -t dumbcontainer ., ad un certo punto ho ottenere un menu interattivo per la scelta di un layout di tastiera:

Adding system user `lightdm' (UID 106) ... 
Adding new user `lightdm' (UID 106) with group `lightdm' ... 
Creating home directory `/var/lib/lightdm' ... 
usermod: no changes 
usermod: no changes 
usermod: no changes 
Adding group `nopasswdlogin' (GID 109) ... 
Done. 
Setting up libnih-dbus1:amd64 (1.0.3-4.3ubuntu1) ... 
Setting up mountall (2.54ubuntu1) ... 
Setting up perl-modules-5.22 (5.22.1-9) ... 
Setting up libperl5.22:amd64 (5.22.1-9) ... 
Setting up perl (5.22.1-9) ... 
update-alternatives: using /usr/bin/prename to provide /usr/bin/rename (rename) in auto mode 
Setting up libpython2.7-stdlib:amd64 (2.7.11-7ubuntu1) ... 
Setting up python2.7 (2.7.11-7ubuntu1) ... 
Setting up libpython-stdlib:amd64 (2.7.11-1) ... 
Setting up python (2.7.11-1) ... 
Setting up libtalloc2:amd64 (2.1.5-2) ... 
Setting up libtevent0:amd64 (0.9.28-0ubuntu0.16.04.1) ... 
Setting up libroken18-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libasn1-8-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libhcrypto4-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libheimbase1-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libwind0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libhx509-5-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libkrb5-26-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libheimntlm0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libgssapi3-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1) ... 
Setting up libsasl2-modules-db:amd64 (2.1.26.dfsg1-14build1) ... 
Setting up libsasl2-2:amd64 (2.1.26.dfsg1-14build1) ... 
Setting up libldap-2.4-2:amd64 (2.4.42+dfsg-2ubuntu3.1) ... 
Setting up libtdb1:amd64 (1.3.8-2) ... 
Setting up libldb1:amd64 (2:1.1.24-1ubuntu3) ... 
Setting up libpython2.7:amd64 (2.7.11-7ubuntu1) ... 
Setting up python-talloc (2.1.5-2) ... 
Setting up samba-libs:amd64 (2:4.3.9+dfsg-0ubuntu0.16.04.2) ... 
Setting up libsmbclient:amd64 (2:4.3.9+dfsg-0ubuntu0.16.04.2) ... 
Setting up libtxc-dxtn-s2tc0:amd64 (0~git20131104-1.1) ... 
update-alternatives: using /usr/lib/x86_64-linux-gnu/libtxc_dxtn_s2tc.so.0 to provide /usr/lib/x86_64-linux-gnu/libtxc_dxtn.so (libtxc-dxtn-x86_64-linux-gnu) in auto mode 
Setting up bzip2 (1.0.6-8) ... 
Setting up distro-info-data (0.28ubuntu0.1) ... 
Setting up eject (2.1.5+deb1+cvs20081104-13.1) ... 
Setting up libmagic1:amd64 (1:5.25-2ubuntu1) ... 
Setting up file (1:5.25-2ubuntu1) ... 
Setting up iproute2 (4.3.0-1ubuntu3) ... 
Setting up ifupdown (0.8.10ubuntu1) ... 
Creating /etc/network/interfaces. 
Setting up libisc-export160 (1:9.10.3.dfsg.P4-8ubuntu1) ... 
Setting up libdns-export162 (1:9.10.3.dfsg.P4-8ubuntu1) ... 
Setting up isc-dhcp-client (4.3.3-5ubuntu12) ... 
Setting up isc-dhcp-common (4.3.3-5ubuntu12) ... 
Setting up keyboard-configuration (1.108ubuntu15) ... 
debconf: unable to initialize frontend: Dialog 
debconf: (TERM is not set, so the dialog frontend is not usable.) 
debconf: falling back to frontend: Readline 
Configuring keyboard-configuration 
---------------------------------- 

The layout of keyboards varies per country, with some countries having multiple 
common layouts. Please select the country of origin for the keyboard of this 
computer. 

    1. Afghani          48. Irish 
    2. Albanian         49. Italian 
    3. Amharic          50. Japanese 
    4. Arabic          51. Japanese (PC-98xx Series) 
    5. Arabic (Morocco)       52. Kazakh 
    ........ 

ho Prova a mettere un'opzione, ma il processo appena bancarelle a quel punto

c'è un modo che io ca n scegliere un'opzione in modo interattivo o fare in modo che la finestra mobile passi un'opzione quando viene richiesto di farlo?

+1

L'esecuzione di applicazioni GUI all'interno di Docker, per non parlare dell'intero gestore di finestre, è ... non banale. Non consiglierei di trattare Docker come una VM leggera. – BMitch

+0

@lurscher potresti trovare una soluzione per questo? – Shanky

risposta

0

provare a impostare una variabile di ambiente TERM prima di eseguire l'installazione: ENV TERM xterm al fine di sbarazzarsi di tale errore, anche se non sono sicuro di come si dovrebbe specificare l'opzione della tastiera.

+0

FYI - questo funziona (impostazione del TERM ENV) se non ti dispiace il prompt interattivo (che ti sembra di essere ok con). Se vuoi qualcosa di completamente automatico, dovresti vedere come specificare l'opzione della tastiera in un altro modo. Ma anche quello che ha detto @bmitch. Vagrant o simili potrebbero essere un'opzione migliore. – ldg

7
  1. copia di un lavoro/etc/default/file della tastiera per la directory che contiene il Dockerfile
  2. Aggiungere la seguente riga al Dockerfile prima di installare o xdm lightdm

    COPIA ./keyboard/etc/default/keyboard file di tastiera

Esempio:

# Check /usr/share/doc/keyboard-configuration/README.Debian for 
# documentation on what to do after having modified this file. 

# The following variables describe your keyboard and can have the same 
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options 
# in /etc/X11/xorg.conf. 

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

# If you don't want to use the XKB layout on the console, you can 
# specify an alternative keymap. Make sure it will be accessible 
# before /usr is mounted. 
# KMAP=/etc/console-setup/defkeymap.kmap.gz 
BACKSPACE="guess" 
+1

Aveva lo stesso problema ... questi passaggi non hanno funzionato per me. Bloccato con lo stesso menu interattivo. – Shanky

+0

Lo stesso qui, non ha risolto il problema –

6

questo dovrebbe funzionare:

DEBIAN_FRONTEND=noninteractive apt-get install lightdm -y 

Ho avuto lo stesso problema l'installazione di CUDA e questo riparato.

+0

Grazie !! Stavo solo cercando di installare un server X in un Dockerfile, ma il 'DEBIAN_FRONTEND = noninteractive' ha fatto lo stesso! –