forked from eborghi10/ros-workshop
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
85 lines (70 loc) · 2.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM osrf/ros:melodic-desktop-bionic
LABEL maintainer="[email protected]"
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV HOME /home/${NB_USER}
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
software-properties-common
RUN add-apt-repository universe
RUN apt-get update && apt-get install -y \
apache2 \
curl \
git \
libgl1-mesa-dev \
netpbm=2:10.0-15.3build1 \
python3 \
python3-pip \
x11-apps=7.7+6ubuntu1 \
xorg \
xvfb=2:1.19.6-1ubuntu4.8
# install ros packages
RUN apt-get update && apt-get install -y \
ros-melodic-common-tutorials \
ros-melodic-ros-tutorials \
&& rm -rf /var/lib/apt/lists/*
# Jupyter ROS
# install npm first
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g n
RUN n stable
RUN pip3 install --upgrade pip
# install jupyter and configure
RUN pip3 install \
bqplot \
ipykernel \
ipywidgets \
jupyterlab \
matplotlib \
notebook \
pyyaml
# Enable extensions in Jupyter Notebooks
RUN jupyter nbextension enable --py widgetsnbextension
RUN pip3 install jupyros
# To install the extension for jupyterlab, you also need to execute the following:
RUN jupyter labextension install jupyter-ros
# Build jupyterlab
RUN jupyter lab build
# https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
# Make sure the contents of our repo are in ${HOME}
COPY . ${HOME}
USER root
RUN chown -R ${NB_USER} ${HOME}
RUN apt-get install -y ros-melodic-teb-local-planner ros-melodic-turtlebot3-simulations
RUN mkdir -p ${HOME}/.ros
RUN chown -R ${NB_USER} ${HOME}/.ros
USER ${NB_USER}
WORKDIR ${HOME}
ENV DISPLAY=:99.0
ENV QT_QPA_PLATFORM=offscreen
RUN /usr/bin/Xorg -depth 16&
# modify the CMD and start a background server first
CMD ["jupyter", "lab", "--no-browser", "--ip", "0.0.0.0"]