Skip to content

made docker images to test in a controlled environment #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions dockerfiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dockerfiles

These dockerfiles are useful for testing the webrtc ros package.

To run them, you will need to:
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]
2. Build the images: `bash build_images.sh`
3. Run the image: `docker run -p 8080:8080 --name <container name> webrtc_ros/<dockerfile>`
4. Open your web-browser and go to http://localhost:8080/
5. Kill the container when done with `docker kill <container name>`

Notes:
- `container name` can be whatever you want
- `dockerfile` should come from the list below
- 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.
- 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

## Available Files:
These are the dockerfiles available
- released: this image is the version released on the package repository
- develop: this image is the version in the github develop branch
- 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]
5 changes: 5 additions & 0 deletions dockerfiles/build_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

docker build -f released -t webrtc_ros/released:latest .
docker build -f develop -t webrtc_ros/develop:latest .
docker build -f dev_awsc14 -t webrtc_ros/dev_awsc14:latest .
7 changes: 7 additions & 0 deletions dockerfiles/dev_awsc14
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM webrtc_ros/develop

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"

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

RUN source "/opt/ros/$ROS_DISTRO/setup.bash" && cd catkin_ws && catkin_make && catkin_make install
12 changes: 12 additions & 0 deletions dockerfiles/develop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM webrtc_ros/released

LABEL description="A docker file to test the develop branch version of webrtc ROS"

SHELL ["/bin/bash", "-c"]

RUN mkdir catkin_ws/src -p
RUN cd catkin_ws/src && git clone https://github.com/RobotWebTools/webrtc_ros.git && cd webrtc_ros && git checkout develop
RUN cd catkin_ws/src/webrtc_ros/webrtc && touch CATKIN_IGNORE
RUN source "/opt/ros/$ROS_DISTRO/setup.bash" && cd catkin_ws && catkin_make && catkin_make install

CMD source "/opt/ros/$ROS_DISTRO/setup.bash" && source "/catkin_ws/install/setup.bash" && ./test-script.sh
18 changes: 18 additions & 0 deletions dockerfiles/released
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM osrf/ros:melodic-desktop-full

LABEL description="A docker file to test the released version of webrtc ROS"

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y apt-utils

RUN apt-get install -y ros-melodic-video-stream-opencv wget
RUN wget http://techslides.com/demos/sample-videos/small.mp4 -O /tmp/small.mp4

COPY test-script.sh test-script.sh
RUN chmod +x test-script.sh

EXPOSE 8080

RUN apt-get install -y ros-melodic-webrtc-ros

CMD ./test-script.sh
2 changes: 2 additions & 0 deletions dockerfiles/test-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
roslaunch video_stream_opencv video_file.launch &
rosrun webrtc_ros webrtc_ros_server_node