Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
HackingOnLiveStreaming

Additional notes

Original blog post - http://blog.alexellis.io/live-stream-with-docker/

How do I rebuild the image from scratch?

This will take several hours on a Raspberry Pi Zero - but less time on a Pi 2 or Pi 3. You can edit the Dockerfile for a Pi 2/3 and change RUN make to RUN make -j 4 to take advantage of the quad-core processor.

$ git clone https://github.com/alexellis/raspberrypi-youtube-streaming/
$ cd streaming
$ docker build -t alexellis2/streaming .

How do I edit the settings?

You should edit the entry.sh file and then write a new Dockerfile using my image as a base:

Place a Dockerfile in a new directory with this contents:

FROM alexellis2/streaming:17-5-2017
COPY entry.sh entry.sh

Then run a Docker build - this should take less than 10 seconds since we're only adding on top of the existing image.

$ cd streaming
$ docker build -t alexellis2/streaming .

How can I enter bash on the container?

You can replace the start-up command (ENTRYPOINT) like this:

$ docker run --entrypoint=/bin/bash --privileged --name cam -ti alexellis2/streaming:17-5-2017

quarterturn commented Jul 20, 2017 edited

When you say "Place a Dockerfile in a new directory" where do you mean for it to go?

If I create, say "temp" directory in /streaming/, and put the Dockerfile inside that and run "docker build..." it fails:
Sending build context to Docker daemon 4.608kB
Step 1/6 : FROM ffmpeg:17-5-2017
repository ffmpeg not found: does not exist or no pull access

If I mv Dockerfile to Dockerfile.orig and create a new Dockerfile containing the "FROM..." and "COPY..." lines above,
it seems to work:
Sending build context to Docker daemon 4.096kB
Step 1/2 : FROM alexellis2/streaming:17-5-2017
---> 63e724cc90ea
Step 2/2 : COPY entry.sh entry.sh
---> 1bdb01e32006
Removing intermediate container c3bdad2f13c4
Successfully built 1bdb01e32006
Successfully tagged alexellis2/streaming:latest

However, running the container it is obvious it did not replace it, as (in my example of what I fixed) the video is still upside down, which means it did not actually copy my edited entry.sh into the container.

I've played around a bit just trying to edit entry.sh by use of "docker exec.." but it is not persistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment