Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from Edvinas01/docker
Browse files Browse the repository at this point in the history
Docker
  • Loading branch information
ugnelis committed Oct 18, 2018
2 parents 991df6f + e57b89a commit 8b41b72
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
@@ -0,0 +1,25 @@
FROM ros:kinetic-ros-base

# Install libraries and tools.
RUN apt-get update \
&& apt-get install -y wget \
&& wget -qO- https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y \
ros-kinetic-web-video-server \
ros-kinetic-rosbridge-suite \
python-pip \
nodejs \
&& pip install Flask

WORKDIR /catkin_ws

# Copy over required source files.
COPY web_console src/web_console
COPY commander src/commander

# Build the source files.
RUN bash -c 'source /opt/ros/kinetic/setup.bash; catkin_make'

# Setup image entry point.
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh", "roslaunch"]
31 changes: 31 additions & 0 deletions README.md
Expand Up @@ -103,6 +103,37 @@ roslaunch web_console web_console.launch
3. **web_console** is now running on http://localhost:9999.
### Running (production, Docker)
1. Build Docker image:
```bash
docker build -t ros-cam .
```
2. Create a Docker network:
```bash
docker network create ros-cam-net
```
3. Start **commander**:
```bash
docker run -dit --rm \
--net ros-cam-net \
--name commander \
ros-cam \
commander commander.launch
```
4. Start **web_console**:
```bash
docker run -dit --rm \
--net ros-cam-net \
--name web_console \
--env ROS_MASTER_URI=http://commander:11311 \
-p 8888:8888 -p 9090:9090 -p 9999:9999 \
ros-cam \
web_console web_console.launch
```
### Running (development)
1. Open first terminal and run **commander** package:
```bash
Expand Down
6 changes: 6 additions & 0 deletions entrypoint.sh
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

source '/opt/ros/kinetic/setup.bash'
source '/catkin_ws/devel/setup.bash'

exec "$@"

0 comments on commit 8b41b72

Please sign in to comment.