Skip to content

Commit 37f5753

Browse files
authored
made docker images to test in a controlled environment (#42)
1 parent cf032be commit 37f5753

File tree

6 files changed

+66
-0
lines changed

6 files changed

+66
-0
lines changed

dockerfiles/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dockerfiles
2+
3+
These dockerfiles are useful for testing the webrtc ros package.
4+
5+
To run them, you will need to:
6+
1. Install Docker: (official docs)[https://docs.docker.com/v17.09/engine/installation/linux/docker-ce/ubuntu/] or (simplified)[https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04]
7+
2. Build the images: `bash build_images.sh`
8+
3. Run the image: `docker run -p 8080:8080 --name <container name> webrtc_ros/<dockerfile>`
9+
4. Open your web-browser and go to http://localhost:8080/
10+
5. Kill the container when done with `docker kill <container name>`
11+
12+
Notes:
13+
- `container name` can be whatever you want
14+
- `dockerfile` should come from the list below
15+
- you could choose to not give the docker container an image when running. You would then want to get the name with `docker container ls` when you are ready to kill it.
16+
- if you want to run with an interactive terminal, use: `docker run -p 8080:8080 -it webrtc_ros/<dockerfile>` (the difference is the `-it` for interactive terminal mode) and then to kill, just press ctrl-c
17+
18+
## Available Files:
19+
These are the dockerfiles available
20+
- released: this image is the version released on the package repository
21+
- develop: this image is the version in the github develop branch
22+
- dev_awsc14: This image is the develop branch and a (fix to the apache web server)[https://github.com/GT-RAIL/async_web_server_cpp/pull/14]

dockerfiles/build_images.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
docker build -f released -t webrtc_ros/released:latest .
4+
docker build -f develop -t webrtc_ros/develop:latest .
5+
docker build -f dev_awsc14 -t webrtc_ros/dev_awsc14:latest .

dockerfiles/dev_awsc14

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM webrtc_ros/develop
2+
3+
LABEL description="A docker file to test the develop branch version of webrtc ROS with the fkie-forks/async_web_server_cpp:apache2_websocket_proxy_workaround"
4+
5+
RUN cd catkin_ws/src && git clone https://github.com/fkie-forks/async_web_server_cpp.git && cd async_web_server_cpp && git checkout apache2_websocket_proxy_workaround
6+
7+
RUN source "/opt/ros/$ROS_DISTRO/setup.bash" && cd catkin_ws && catkin_make && catkin_make install

dockerfiles/develop

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM webrtc_ros/released
2+
3+
LABEL description="A docker file to test the develop branch version of webrtc ROS"
4+
5+
SHELL ["/bin/bash", "-c"]
6+
7+
RUN mkdir catkin_ws/src -p
8+
RUN cd catkin_ws/src && git clone https://github.com/RobotWebTools/webrtc_ros.git && cd webrtc_ros && git checkout develop
9+
RUN cd catkin_ws/src/webrtc_ros/webrtc && touch CATKIN_IGNORE
10+
RUN source "/opt/ros/$ROS_DISTRO/setup.bash" && cd catkin_ws && catkin_make && catkin_make install
11+
12+
CMD source "/opt/ros/$ROS_DISTRO/setup.bash" && source "/catkin_ws/install/setup.bash" && ./test-script.sh

dockerfiles/released

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM osrf/ros:melodic-desktop-full
2+
3+
LABEL description="A docker file to test the released version of webrtc ROS"
4+
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y apt-utils
7+
8+
RUN apt-get install -y ros-melodic-video-stream-opencv wget
9+
RUN wget http://techslides.com/demos/sample-videos/small.mp4 -O /tmp/small.mp4
10+
11+
COPY test-script.sh test-script.sh
12+
RUN chmod +x test-script.sh
13+
14+
EXPOSE 8080
15+
16+
RUN apt-get install -y ros-melodic-webrtc-ros
17+
18+
CMD ./test-script.sh

dockerfiles/test-script.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
roslaunch video_stream_opencv video_file.launch &
2+
rosrun webrtc_ros webrtc_ros_server_node

0 commit comments

Comments
 (0)