Skip to content

Commit

Permalink
Merge pull request #3 from kolonuk/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
kolonuk authored Jul 31, 2018
2 parents f8da0da + 5788477 commit 2395ac6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM ubuntu
FROM kolonuk/get_iplayer-docker-base

RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install atomicparsley ffmpeg perl libjson-pp-perl libxml-perl libxml-libxml-simple-perl liblwp-protocol-https-perl libmojolicious-perl libcgi-fast-perl wget bash cron -y
RUN echo $'\#!/bin/bash\n\
if [[ ! -f /root/get_iplayer.cgi ]]\n\
then\n\
Expand All @@ -13,28 +10,25 @@ fi\n\
if [[ ! -f /root/.get_iplayer/options ]]\n\
then\n\
echo No options file found, adding some nice defaults...\n\
/root/get_iplayer --prefs-add --overwrite\n\
/root/get_iplayer --prefs-add --force\n\
/root/get_iplayer --prefs-add --whitespace\n\
/root/get_iplayer --prefs-add --modes=tvbest,radiobest\n\
/root/get_iplayer --prefs-add --subtitles\n\
/root/get_iplayer --prefs-add --subs-embed\n\
/root/get_iplayer --prefs-add --metadata\n\
/root/get_iplayer --prefs-add --nopurge\n\
fi\n\
echo Forcing output location...\n\
/root/get_iplayer --prefs-add --output="/root/output/"\n\
/usr/bin/perl /root/get_iplayer.cgi --port 8181 --getiplayer /root/get_iplayer\n\
' > /root/start.sh && chmod 755 /root/start.sh

RUN crontab -l | { cat; echo "@hourly /root/get_iplayer --refresh --refresh-future --type=all --nopurge > /proc/1/fd/1 2>&1"; } | crontab -
RUN crontab -l | { cat; echo "@hourly /root/get_iplayer --type=all --pvr --nopurge > /proc/1/fd/1 2>&1"; } | crontab -
RUN crontab -l | { cat; echo "@hourly /root/get_iplayer --refresh > /proc/1/fd/1 2>&1"; } | crontab -
RUN crontab -l | { cat; echo "@hourly /root/get_iplayer --pvr > /proc/1/fd/1 2>&1"; } | crontab -

VOLUME /root/.get_iplayer
VOLUME /root/output

LABEL maintainer="John Wood <john@kolon.co.uk>"
LABEL issues_kolonuk/get_iplayer="Comments/issues for this dockerfile: https://github.com/kolonuk/get_iplayer/issues"
LABEL issues_get_iplayer="https://forums.squarepenguin.co.uk"
LABEL issues_get_iplayer="Comments/issues for get_iplayer: <a href=\"https://forums.squarepenguin.co.uk\"> here </a>"

EXPOSE 8181

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Disappointed with the current availability of get_iplayer in docker, I set my self the task of creating my first docker container.

For now, this uses the plain Ubuntu image, so is huge for a very simply perl program - definitely needs the packages trimming. I'm going to add a testing branch to the github repo so that I can experiment with either alpine or busybox to see if I can get this reduces.
For now, this uses the plain Ubuntu image, so is huge for a very simply perl program - definitely needs the packages trimming. I've added a testing branch to the github repo so that I can experiment with either other base images to see if I can get this reduced in size - current uncompressed ubuntu is around 400mb.

## Usage
docker create \
Expand All @@ -14,27 +14,27 @@ For now, this uses the plain Ubuntu image, so is huge for a very simply perl pro
kolonuk/get_iplayer

* Backup your current config and recordings.
* Mount `/root/.get_iplayer` to your config directory. This should incoude your `options` file and `pvr` directory. If starting from scratch, you can manually edit the `options` file created here.
* Mount `/root/output` to your current recordings location.

**WARNING - get_iplayer stores cookies in your browser for some default settings. Becuase of this, at least try to see if you can find those cookies BEFORE loading the newly installed container.**
* Mount `/root/.get_iplayer` to your config directory. This should include your `options` file and `pvr` directory. If starting from scratch, you can manually edit the `options` file created here.
* Mount `/root/output` to your recordings location.

**WARNING - get_iplayer stores cookies in your browser for some default settings. Because of this, at least try to see if you can find those cookies and remove them BEFORE loading the newly installed container.**

## Start
Upon first start, it will download the latest get_iplayer scripts from the official github repo <https://github.com/get-iplayer/get_iplayer>. This is different from other docker containers in that when the version of get_iplayer changes, you just need to re-create this container and it will have the latest working versions. Currently, it just grabs the raw source code, but the next step is to actually check the releases and upgrade when a new release is available.
Upon first start, it will download the latest get_iplayer scripts from the official github repo <https://github.com/get-iplayer/get_iplayer>. This is different from other docker containers in that when the version of get_iplayer is not static, you just need to re-create this container and it will have the latest version from the get_iplayer repo. Currently, it just grabs the raw source code, but the next step is to actually check the releases and upgrade when a new release is available.

* When starting this for the first time, it will create some nice newbie default options (allow repeat downloads, allow overwrite, enable whitespace in filenames, etc.).
* When starting this using existing configuration files, it will forcibly change the output location to the container's output volume location, thus hopefully, it should "just work".
**Watchtower <https://github.com/v2tec/watchtower> will not update this container to the latest version of get_iplayer. Until Docker introduces monitoring of alternative github repos for automated builds (to trigger watchtower), this is the best you can get.** To update, either delete `/root/get_iplayer*` in the container, or recreate it - I use Portainer <https://hub.docker.com/r/portainer/portainer/> and just hit the `Recreate` button.

**Watchtower <https://github.com/v2tec/watchtower> will not update this container to the latest version of get_iplayer. Until Docker introduces monitoring of alternative github repos, this is the best you can get.** To update, either delete `/root/get_iplayer*` in the container, or recreate it - I use Portainer <https://hub.docker.com/r/portainer/portainer/> and just hit the `Recreate` button.
* When starting this for the first time, it will create some nice newbie default options (enable whitespace in filenames, etc.).
* When starting this using existing configuration files, it will forcibly change the output location to the container's output volume location, thus hopefully, it should "just work".

## Issues
* Report issues with this dockerfile <https://github.com/kolonuk/get_iplayer/issues>
* Report issues with get_iplayer script <https://squarepenguin.co.uk/forums/>
* Report issues with the get_iplayer script <https://squarepenguin.co.uk/forums/>

## About me
Just a small-time tinkerer of almost anything computer-related (servers, raspi, networks, programming, android, etc.). I am active on various places on the net, like StackExchange, github, and some mailing lists, etc., so ping me a message about anything - if I don't know, I'll know where to go to find out!

## Todo
1. Check different base os's for Dockerfile
2. Auto update check script for the get_iplayer github repo
2. Remove as much gumf as possible
3. Auto update check script for the get_iplayer github repo releases

0 comments on commit 2395ac6

Please sign in to comment.