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
This worked well for me and explained things very well. The only thing I would add is that you can tag your docker images you create with the build command so that if you need to roll back after a experiment it is easier to do instead of using latest.
You can accomplish this by using the command:
docker tag IMAGE ID alexellis2/streaming:VERSION
Where IMAGE ID is the number from the column of that label shown when you run the command:
docker image ls
Where VERSION is a unique name you can remember and use in place of latest in your run command. This lets you return to older ideas or roll back if you mess something up to a version you know worked.