The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mirto (20) [Avatar] Offline
#1
On page 82 the dockerfile reads (note line 6):

FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y firefox [#A]
RUN groupadd -g GID USERNAME [#B]
RUN useradd -d /home/USERNAME -s /bin/bash \
-m dockerinpractice -u UID -g GID  [#C]
USER USERNAME [#D]
ENV HOME /home/USERNAME [#E]
CMD /usr/bin/firefox  [#F]


Instead it should read:
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y firefox [#A]
RUN groupadd -g GID USERNAME [#B]
RUN useradd -d /home/USERNAME -s /bin/bash \
-m USERNAME -u UID -g GID  [#C]
USER USERNAME [#D]
ENV HOME /home/USERNAME [#E]
CMD /usr/bin/firefox  [#F]


The first works only if USERNAME = dockerinpractice

BTW the example didnt work:
first you have to issue the command
xhost +


But also with this you receive the error :
sysop@k1510docker:~/sviluppo/dockergui$ docker run -v /tmp/X11-unix:/tmp/X11-unix:rw -e DISPLAY=$DISPLAY gui
Error: cannot open display: :0
sysop@k1510docker:~/sviluppo/dockergui$



Mybe a framebuffer is missing?

See http://stackoverflow.com/questions/32151043/xvfb-docker-cannot-open-display




aidanhs (25) [Avatar] Offline
#2
Hi mirto, thanks for reporting the issues here

- We modified the hardcoded 'dockerinpractice'.

- Regarding the broken `docker run` command, I was able to reproduce this so added some extra flags to the `docker run` command (setting the hostname to the same as the host, and mounting the xauthority file). It seems that Ubuntu 12.04 (the distro this technique was based on) behaved differently to Ubuntu 14.04 (the host I reproduced the issue on).

The changes seemed to fix it for me, and hopefully they have for you too! Just wanted to say thanks for reporting.

Aidan