File tree 3 files changed +16
-9
lines changed
3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,13 @@ RUN chmod +x /opt/selenium/local-sel-headless.sh
117
117
# ===========
118
118
# DNS stuff
119
119
# ===========
120
- # Poor man /etc/hosts updates until https://github.com/dotcloud/docker/issues/2267
121
- # Ref: https://stackoverflow.com/questions/19414543/how-can-i-make-etc-hosts-writable-by-root-in-a-docker-container
122
120
ADD ./etc/hosts /tmp/hosts
123
- RUN mkdir -p -- /lib-override && cp /lib/x86_64-linux-gnu/libnss_files.so.2 /lib-override
124
- RUN perl -pi -e 's:/etc/hosts:/tmp/hosts:g' /lib-override/libnss_files.so.2
125
- ENV LD_LIBRARY_PATH /lib-override
121
+ # Below hack is no longer necessary since docker >= 1.2.0, commented to ease old users transition
122
+ # Poor man /etc/hosts updates until https://github.com/dotcloud/docker/issues/2267
123
+ # Ref: https://stackoverflow.com/questions/19414543/how-can-i-make-etc-hosts-writable-by-root-in-a-docker-container
124
+ # RUN mkdir -p -- /lib-override && cp /lib/x86_64-linux-gnu/libnss_files.so.2 /lib-override
125
+ # RUN perl -pi -e 's:/etc/hosts:/tmp/hosts:g' /lib-override/libnss_files.so.2
126
+ # ENV LD_LIBRARY_PATH /lib-override
126
127
127
128
# ============================
128
129
# Some configuration options
Original file line number Diff line number Diff line change 2
2
export GEOMETRY=" $SCREEN_WIDTH " " x" " $SCREEN_HEIGHT " " x" " $SCREEN_DEPTH "
3
3
export CONTAINER_IP=$( ip addr show dev eth0 | grep " inet " | awk ' {print $2}' | cut -d ' /' -f 1)
4
4
export DOCKER_HOST_IP=$( netstat -nr | grep ' ^0\.0\.0\.0' | awk ' {print $2}' )
5
+ export VNC_PORT=5900
5
6
export XVFB_LOG=" /tmp/Xvfb_headless.log"
6
7
export FLUXBOX_LOG=" /tmp/fluxbox_manager.log"
7
- export X11VNC_LOG=" /tmp/x11vnc_forever.log"
8
+ export VNC_LOG=" /tmp/x11vnc_forever.log"
9
+ export XTERMINAL_LOG=" /tmp/local-sel-headless.log"
10
+
11
+ # As of docker >= 1.2.0 is possible to append our stuff directly into /etc/hosts
12
+ cat /tmp/hosts >> /etc/hosts
13
+ echo " docker.host.dev $DOCKER_HOST_IP " >> /etc/hosts
14
+ echo " docker.guest.dev $CONTAINER_IP " >> /etc/hosts
8
15
9
16
# Start the X server that can run on machines with no display
10
17
# hardware and no physical input devices
@@ -20,7 +27,7 @@ sleep 0.5
20
27
21
28
# Start a GUI xTerm to easily debug the headless instance
22
29
x-terminal-emulator -geometry 100x30+10+10 -ls -title " local-sel-headless" \
23
- -e " /opt/selenium/local-sel-headless.sh" &
30
+ -e " /opt/selenium/local-sel-headless.sh" 2>&1 | tee $XTERMINAL_LOG &
24
31
25
32
# Start VNC server to enable viewing what's going on but not mandatory
26
- x11vnc -forever -usepw -display $DISPLAY > $X11VNC_LOG 2>&1
33
+ x11vnc -forever -usepw -shared -rfbport $VNC_PORT - display $DISPLAY > $VNC_LOG 2>&1
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
sudo -E -i -u user1 \
4
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH \
5
4
DOCKER_HOST_IP=$DOCKER_HOST_IP \
6
5
java -jar /opt/selenium/selenium-server-standalone.jar -port $SELENIUM_PORT
You can’t perform that action at this time.
0 commit comments