forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile for Binder (RobotLocomotion#12472)
- Loading branch information
1 parent
5b10b07
commit 67e9166
Showing
11 changed files
with
96 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- mode: dockerfile -*- | ||
# vi: set ft=dockerfile : | ||
|
||
# TODO(jamiesnape): Use a different tag. Per the Binder documentation, a tag | ||
# named "latest" is not allowed, however they do not (yet) enforce that | ||
# restriction. | ||
FROM robotlocomotion/drake:latest | ||
ARG NB_USER=jovyan | ||
ARG NB_UID=1000 | ||
ARG NB_GID=100 | ||
EXPOSE 8888/tcp | ||
RUN export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get update -qq \ | ||
&& apt-get install --no-install-recommends -qq \ | ||
-o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew \ | ||
-o Dpkg::Use-Pty=0 \ | ||
locales \ | ||
xvfb \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& locale-gen en_US.UTF-8 \ | ||
&& useradd -d "/home/$NB_USER" -G $NB_GID -mU -s /bin/bash "$NB_USER" | ||
USER "$NB_USER" | ||
ENV HOME="/home/$NB_USER" \ | ||
LANG=en_US.UTF-8 \ | ||
LANGUAGE=en_US.UTF-8 \ | ||
LC_ALL=en_US.UTF-8 \ | ||
SHELL=/bin/bash \ | ||
USER="$NB_USER" | ||
WORKDIR $HOME | ||
COPY --chown=$NB_UID:$NB_GID \ | ||
[".binder/binder-entrypoint", "/opt/drake/bin/binder-entrypoint"] | ||
COPY --chown=$NB_UID:$NB_GID ["tutorials/*.ipynb", "$HOME/tutorials/"] | ||
ENTRYPOINT ["/opt/drake/bin/binder-entrypoint"] | ||
CMD ["jupyter", "notebook", "--ip", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Docker Image for Binder | ||
|
||
*Note that due to Binder conventions, this directory MUST always be in the root | ||
of the repository and named either `binder` or `.binder`. This image is NOT | ||
intended for use by most developers or users. Please use the | ||
[robotlocomotion/drake](https://hub.docker.com/r/robotlocomotion/drake) image | ||
from Docker Hub instead.* | ||
|
||
To create a Docker image and run a Docker container similar to those used by | ||
[Binder](https://mybinder.org) for debugging purposes, execute the following | ||
commands from the top level of the Drake Git repository: | ||
|
||
```bash | ||
docker build -f .binder/Dockerfile -t binder . | ||
docker run --name mybinder -p 8888:8888 binder | ||
``` | ||
|
||
Copy and paste the URL (including the login token) that is displayed in the | ||
terminal into the web browser of your choice. | ||
|
||
To stop the running container, execute the following command in a new terminal: | ||
|
||
```bash | ||
docker stop mybinder | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash -l | ||
|
||
set -euxo pipefail | ||
|
||
# Some examples need a virtual X server environment for offscreen rendering. | ||
xvfb-run -a "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters