|
| 1 | +FROM kaixhin/vnc |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +RUN apt-get update && apt-get install -y \ |
| 6 | + curl \ |
| 7 | + zip \ |
| 8 | + unzip \ |
| 9 | + software-properties-common \ |
| 10 | + python-software-properties && \ |
| 11 | + apt-get clean && \ |
| 12 | + rm -rf /var/lib/apt/lists/* |
| 13 | + |
| 14 | +# We need to add a custom PPA to pick up JDK8, since trusty doesn't |
| 15 | +# have an openjdk8 backport. openjdk-r is maintained by a reliable contributor: |
| 16 | +# Matthias Klose (https://launchpad.net/~doko). It will do until |
| 17 | +# we either update the base image beyond 14.04 or openjdk-8 is |
| 18 | +# finally backported to trusty; see e.g. |
| 19 | +# https://bugs.launchpad.net/trusty-backports/+bug/1368094 |
| 20 | +RUN 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 |
| 28 | + |
| 29 | +# Running bazel inside a `docker build` command causes trouble, cf: |
| 30 | +# https://github.com/bazelbuild/bazel/issues/134 |
| 31 | +# The easiest solution is to set up a bazelrc file forcing --batch. |
| 32 | +# RUN echo "startup --batch" >>/root/.bazelrc |
| 33 | +# Similarly, we need to workaround sandboxing issues: |
| 34 | +# https://github.com/bazelbuild/bazel/issues/418 |
| 35 | +# RUN echo "build --spawn_strategy=standalone --genrule_strategy=standalone" \ |
| 36 | +# >>/root/.bazelrc |
| 37 | +# ENV BAZELRC /root/.bazelrc |
| 38 | +# Install the most recent bazel release. |
| 39 | +ENV BAZEL_VERSION 0.4.3 |
| 40 | +RUN mkdir /bazel && \ |
| 41 | + cd /bazel && \ |
| 42 | + curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ |
| 43 | + curl -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE.txt && \ |
| 44 | + chmod +x bazel-*.sh && \ |
| 45 | + ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ |
| 46 | + cd / && \ |
| 47 | + rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh |
| 48 | + |
| 49 | +# Install deepmind-lab dependencies |
| 50 | +RUN 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 |
| 62 | + |
| 63 | +#Enable RANDR option for vnc server. |
| 64 | +COPY ./vnc.sh /opt/vnc.sh |
| 65 | + |
| 66 | +# Set the default X11 Display. |
| 67 | +ENV DISPLAY :1 |
| 68 | + |
| 69 | +ENV lab_dir /lab |
| 70 | +RUN mkdir /$lab_dir |
| 71 | +COPY . /$lab_dir |
| 72 | +WORKDIR $lab_dir |
| 73 | + |
| 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 |
| 79 | + |
| 80 | + |
| 81 | + |
0 commit comments