1- FROM kaixhin/vnc
1+ FROM ubuntu:14.04
22
33MAINTAINER fcarey@gmail.com
44
5+ # Temporarily shut up warnings.
6+ ENV DISPLAY :0
7+ ENV TERM xterm
8+
9+ # Basic Dependencies
510RUN apt-get update && apt-get install -y \
611 curl \
712 zip \
813 unzip \
914 software-properties-common \
1015 python-software-properties && \
11- apt-get clean && \
12- rm -rf /var/lib/apt/lists/*
16+ apt-get clean && \
17+ rm -rf /var/lib/apt/lists/*
18+
19+ # Dependencies for vnc setup.
20+ RUN apt-get update && apt-get install -y \
21+ xvfb \
22+ fluxbox \
23+ x11vnc && \
24+ apt-get clean && \
25+ rm -rf /var/lib/apt/lists/*
26+
1327
1428# We need to add a custom PPA to pick up JDK8, since trusty doesn't
1529# have an openjdk8 backport. openjdk-r is maintained by a reliable contributor:
@@ -18,13 +32,14 @@ RUN apt-get update && apt-get install -y \
1832# finally backported to trusty; see e.g.
1933# https://bugs.launchpad.net/trusty-backports/+bug/1368094
2034RUN add-apt-repository -y ppa:openjdk-r/ppa && \
21- apt-get update && \
22- apt-get install -y openjdk-8-jdk openjdk-8-jre-headless && \
23- apt-get clean && \
24- rm -rf /var/lib/apt/lists/* && \
25- which java && \
26- java -version && \
27- update-ca-certificates -f
35+ apt-get update && apt-get install -y \
36+ openjdk-8-jdk \
37+ openjdk-8-jre-headless && \
38+ apt-get clean && \
39+ rm -rf /var/lib/apt/lists/* && \
40+ which java && \
41+ java -version && \
42+ update-ca-certificates -f
2843
2944# Running bazel inside a `docker build` command causes trouble, cf:
3045# https://github.com/bazelbuild/bazel/issues/134
@@ -48,34 +63,44 @@ RUN mkdir /bazel && \
4863
4964# Install deepmind-lab dependencies
5065RUN apt-get update && apt-get install -y \
51- lua5.1 \
52- liblua5.1-0-dev \
53- libffi-dev \
54- gettext \
55- freeglut3-dev \
56- libsdl2-dev \
57- libosmesa6-dev \
58- python-dev \
59- python-numpy \
60- realpath \
61- build-essential
66+ lua5.1 \
67+ liblua5.1-0-dev \
68+ libffi-dev \
69+ gettext \
70+ freeglut3-dev \
71+ libsdl2-dev \
72+ libosmesa6-dev \
73+ python-dev \
74+ python-numpy \
75+ realpath \
76+ build-essential && \
77+ apt-get clean && \
78+ rm -rf /var/lib/apt/lists/*
6279
63- # Enable RANDR option for vnc server.
64- COPY ./vnc.sh /opt/vnc.sh
6580
6681# Set the default X11 Display.
6782ENV DISPLAY :1
83+ ENV VNC_PASSWORD=password
84+ ENV XVFB_RESOLUTION=800x600x16
6885
86+ # Set up deepmind-lab folder and copy in the code.
6987ENV lab_dir /lab
7088RUN mkdir /$lab_dir
7189COPY . /$lab_dir
7290WORKDIR $lab_dir
7391
74- RUN bazel build :deepmind_lab.so --define headless=osmesa
75-
76- # RUN bazel run :python_module_test --define headless=osmesa
77-
78- # RUN bazel run :random_agent --define headless=false
92+ # Run an actual (headless) build since this should make subsequent builds much faster.
93+ # Alternative commands based on the Documentation:
94+ # RUN bazel run :random_agent --define headless=false
95+ # RUN bazel build :deepmind_lab.so --define headless=osmesa
96+ RUN bazel run :python_module_test --define headless=osmesa
7997
98+ # This port is the default for connecting to VNC display :1
99+ EXPOSE 5901
80100
101+ # Copy VNC script that handles restarts and make it executable.
102+ COPY ./.docker/startup.sh /opt/
103+ RUN chmod u+x /opt/startup.sh
81104
105+ # Finally, start VNC using our script.
106+ CMD ["/opt/startup.sh" ]
0 commit comments