diff options
Diffstat (limited to 'edge/sample/live_stream_app/docker')
-rw-r--r-- | edge/sample/live_stream_app/docker/Dockerfile | 29 | ||||
-rw-r--r-- | edge/sample/live_stream_app/docker/build.sh | 16 | ||||
-rw-r--r-- | edge/sample/live_stream_app/docker/src/uv4l_start.sh | 16 |
3 files changed, 61 insertions, 0 deletions
diff --git a/edge/sample/live_stream_app/docker/Dockerfile b/edge/sample/live_stream_app/docker/Dockerfile new file mode 100644 index 0000000..82e9d13 --- /dev/null +++ b/edge/sample/live_stream_app/docker/Dockerfile @@ -0,0 +1,29 @@ +FROM resin/raspberrypi3-debian:stretch + +WORKDIR / +ADD src/uv4l_start.sh / +RUN chmod +x uv4l_start.sh + +RUN curl http://www.linux-projects.org/listing/uv4l_repo/lpkey.asc | apt-key add - +RUN echo "deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/stretch stretch main" | tee -a /etc/apt/sources.list + +RUN apt-get update +RUN apt-get install -y \ + uv4l \ + uv4l-server \ + uv4l-uvc \ + uv4l-xscreen \ + uv4l-mjpegstream \ + uv4l-dummy \ + uv4l-raspidisp \ + uv4l-webrtc \ + uv4l-raspicam \ + fuse + +EXPOSE 9090 + +ENTRYPOINT [ "/uv4l_start.sh" ] +CMD ["720", "480", "20"] + + + diff --git a/edge/sample/live_stream_app/docker/build.sh b/edge/sample/live_stream_app/docker/build.sh new file mode 100644 index 0000000..98a7379 --- /dev/null +++ b/edge/sample/live_stream_app/docker/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# +# Copyright (c) Authors of Clover +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +IMAGE_PATH=${IMAGE_PATH:-"localhost:5000"} +IMAGE_NAME=${IMAGE_NAME:-"clover-live-stream"} + +docker build -t $IMAGE_NAME . +docker tag $IMAGE_NAME $IMAGE_PATH/$IMAGE_NAME +docker push $IMAGE_PATH/$IMAGE_NAME diff --git a/edge/sample/live_stream_app/docker/src/uv4l_start.sh b/edge/sample/live_stream_app/docker/src/uv4l_start.sh new file mode 100644 index 0000000..69dbdec --- /dev/null +++ b/edge/sample/live_stream_app/docker/src/uv4l_start.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +trap cleanup 2 3 15 + +cleanup() +{ + pkill uv4l + exit 1 +} + +uv4l -nopreview --auto-video_nr --driver raspicam --encoding mjpeg --width $1 --height $2 --framerate $3 --server-option '--port=9090' --server-option '--max-queued-connections=30' --server-option '--max-streams=25' --server-option '--max-threads=29' + +while true +do + sleep 15 +done |