Skip to content
Snippets Groups Projects
Commit d71875b2 authored by TIm Kluge's avatar TIm Kluge
Browse files

Add DOCKERFILE

parent 16992f92
No related branches found
No related tags found
No related merge requests found
FROM osrf/ros:melodic-desktop-full-bionic
ENV uid 1000
ENV 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
WORKDIR /home/$USERNAME
COPY src /home/$USERNAME/src
RUN apt-get update && apt-get install -y \
python-catkin-tools bash
RUN rosdep install --from-paths . -r -y
RUN catkin config \
--extend /opt/ros/melodic && \
catkin build
ENTRYPOINT ["/entrypoint.sh"]
...@@ -44,5 +44,12 @@ See the [README.md of the submodule](../../../../sample_applications/-/blob/mast ...@@ -44,5 +44,12 @@ 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 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` - Execution of a velocity constraint cartesian trajectory: `roslaunch sample_applications simulation.launch`
## Docker
To run via docker on any up-to-date linux system:
- `docker build . -t ceti-panda-gazebo-workspace`
- `./docker-run.sh roslaunch sample_applications sample_simple_simulation.launch`
Note that this expects your `uid` and `gid` to be `1000`. This is generally the case if your user is the primary user on your system. Otherwise, please change
the values at the top of the `Dockerfile`.
\ No newline at end of file
#!/bin/bash
# http://wiki.ros.org/docker/Tutorials/GUI
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" \
--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