Skip to content
Snippets Groups Projects
Commit 7391d826 authored by Johannes Mey's avatar Johannes Mey
Browse files

Merge branch 'master' into 'master'

Add DOCKERFILE

This adds a docker setup as in #1 to run the examples and some hints in the readme on how to use it.

It uses the "isolated" way to run GUI in docker containers described in http://wiki.ros.org/docker/Tutorials/GUI#The_isolated_way . I think it should be sufficiently secure. The only downside is that you have to change the `DOCKERFILE` if your user is not the primary user on your system.

See merge request !1
parents 16992f92 b616f8f9
No related branches found
No related tags found
No related merge requests found
FROM osrf/ros:melodic-desktop-full-bionic
ARG uid=1000
ARG gid=1000
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV USERNAME ros
RUN useradd -m $USERNAME && \
echo "$USERNAME:$USERNAME" | chpasswd && \
usermod --shell /bin/bash $USERNAME && \
usermod -aG sudo $USERNAME && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
# Replace 1000 with your user/group id
usermod --uid $uid $USERNAME && \
groupmod --gid $gid $USERNAME
RUN apt-get update && apt-get install -y \
python-catkin-tools bash
WORKDIR /home/$USERNAME
COPY src /home/$USERNAME/src
RUN rosdep install --from-paths . -r -y
RUN catkin config \
--extend /opt/ros/melodic && \
catkin build
ENTRYPOINT ["/entrypoint.sh"]
......@@ -44,5 +44,11 @@ See the [README.md of the submodule](../../../../sample_applications/-/blob/mast
- Execution of a simple motion costraint by a blocking object: `roslaunch sample_applications sample_constraint_simulation.launch`
- Execution of a velocity constraint cartesian trajectory: `roslaunch sample_applications simulation.launch`
## Docker
To run via docker on any up-to-date linux system:
- Clone this repo and its submodules (recommended for fresh installations):
- as a guest: `git clone --recurse-submodules https://git-st.inf.tu-dresden.de/ceti/ros/panda_gazebo_workspace.git panda_gazebo_workspace`
- as a project member with a registered ssh key: `git clone --recurse-submodules git@git-st.inf.tu-dresden.de:ceti/ros/panda_gazebo_workspace.git panda_gazebo_workspace`
- Run `./docker-run.sh roslaunch sample_applications sample_simple_simulation.launch` to build and run a docker image tagged with `ceti-panda-gazebo-workspace`
\ No newline at end of file
#!/bin/bash
# http://wiki.ros.org/docker/Tutorials/GUI
docker build . -t ceti-panda-gazebo-workspace \
--build-arg UID=$UID \
--build-arg GID=$GID
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run -it \
--volume=$XSOCK:$XSOCK:rw \
--volume=$XAUTH:$XAUTH:rw \
--env="XAUTHORITY=${XAUTH}" \
--env="DISPLAY" \
--device=/dev/dri \
--group-add video \
--user="ros" \
ceti-panda-gazebo-workspace \
"$@"
\ No newline at end of file
#!/bin/bash
source /opt/ros/melodic/setup.bash
source $HOME/devel/setup.bash
exec "$@"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment