From de10a16823eff5620489326ae3aa028edb83f0c8 Mon Sep 17 00:00:00 2001 From: anthonyraymond Date: Thu, 29 Dec 2016 00:40:23 +0100 Subject: [PATCH 1/3] Add dockerfile for raspberry build --- rpi-Dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 rpi-Dockerfile diff --git a/rpi-Dockerfile b/rpi-Dockerfile new file mode 100644 index 0000000..8295e50 --- /dev/null +++ b/rpi-Dockerfile @@ -0,0 +1,41 @@ +FROM resin/rpi-raspbian + +# less priviledge user, the id should map the user the downloaded files belongs to +RUN groupadd -r aria && useradd -r -g aria aria -u 1000 + +# webui + aria2 +RUN apt-get update \ + && apt-get install -y aria2 busybox curl git \ + && rm -rf /var/lib/apt/lists/* + +ADD . /webui-aria2 + +# gosu install latest +RUN GITHUB_REPO="https://github.com/tianon/gosu" \ + && LATEST=`curl -s $GITHUB_REPO"/releases/latest" | grep -Eo "[0-9].[0-9]*"` \ + && curl -L $GITHUB_REPO"/releases/download/"$LATEST"/gosu-armhf" > /usr/local/bin/gosu \ + && chmod +x /usr/local/bin/gosu + +# goland install (compile source code for ARM since no version are currently available) +RUN curl -L "https://storage.googleapis.com/golang/go1.6.1.linux-armv6l.tar.gz" > go.tar.gz \ + && tar -xzf go.tar.gz -C /usr/local \ + && export GOROOT="/usr/local/go" && export GOPATH=`pwd` \ + && $GOROOT/bin/go get github.com/mattn/goreman && $GOROOT/bin/go build -o /usr/local/bin/goreman github.com/mattn/goreman \ + && apt-get remove purge --auto-remove git \ + && rm go.tar.gz && rm -rf $GOROOT && rm -rf $GOPATH/src && rm -rf $GOPATH/pkg \ + && unset GOROOT && unset GOPATH + +# goreman setup +RUN echo "web: gosu aria /bin/busybox httpd -f -p 8080 -h /webui-aria2\nbackend: gosu aria /usr/bin/aria2c --conf-path=/data/.aria2/aria2.conf" > Procfile + +# aria2 downloads directory +VOLUME /data + +# aria2 RPC port, map as-is or reconfigure webui +EXPOSE 6800/tcp + +# webui static content web server, map wherever is convenient +EXPOSE 8080/tcp + +CMD ["start"] +ENTRYPOINT ["/usr/local/bin/goreman"] From 552faf72e0322e0c7e36e88f65eae32fff59ac19 Mon Sep 17 00:00:00 2001 From: anthonyraymond Date: Thu, 29 Dec 2016 20:27:25 +0100 Subject: [PATCH 2/3] Update README.md to introduce raspberry dockerfile (ARM) --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 2c54d56..bb4af46 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ Well, you need aria2. And a web browser (if that even counts!) Docker support ============== +There is two Dockerfile in this project, one is a common Dockerfile, which can be use for **testing purpose**.
+The second is a **production ready** Dockerfile for raspberry and other ARM plateforms. + +### For testing purpose + You can also try or use webui-aria2 in your LAN inside a Docker sandbox. Build the image @@ -51,6 +56,28 @@ sudo docker run -v /Downloads:/data -p 6800:6800 -p 9100:8080 --name="webui-aria `/Downloads` is the directory in the host where you want to keep the downloaded files +### Production ready (ARM platform) + +This image contains both aria2 and webui-aria2. + +Build it +``` +docker build -f rpi-Dockerfile -t yourname/webui-aria2 . +``` +Prepare the host volume: +This image required few file to be mounted in the container's `/data` folder. +``` +.aria2/session.txt (empty file) +.aria2/aria2.log (empty file) +.aria2/aria2.conf (aria2 configuration file, not webui-aria2 conf) +./downloads/ (where the downloaded files goes) +``` + +Run it +``` +docker run -d -v /home//data/aria2:/data -p 6800:6800 -p 9100:8080 --name="webui-aria2" yourname/webui-aria2 +``` + Support ======= For any support, feature request and bug report add an issue in the github project. [link](https://github.com/ziahamza/webui-aria2/issues) From e68fda07b9cc6190e13c44efbae7bab0f1a2fb4a Mon Sep 17 00:00:00 2001 From: anthonyraymond Date: Fri, 30 Dec 2016 21:05:44 +0100 Subject: [PATCH 3/3] Fix purge 'apt-get remove' purge flag --- rpi-Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpi-Dockerfile b/rpi-Dockerfile index 8295e50..a6a9b87 100644 --- a/rpi-Dockerfile +++ b/rpi-Dockerfile @@ -21,7 +21,7 @@ RUN curl -L "https://storage.googleapis.com/golang/go1.6.1.linux-armv6l.tar.gz" && tar -xzf go.tar.gz -C /usr/local \ && export GOROOT="/usr/local/go" && export GOPATH=`pwd` \ && $GOROOT/bin/go get github.com/mattn/goreman && $GOROOT/bin/go build -o /usr/local/bin/goreman github.com/mattn/goreman \ - && apt-get remove purge --auto-remove git \ + && apt-get remove --purge --auto-remove git \ && rm go.tar.gz && rm -rf $GOROOT && rm -rf $GOPATH/src && rm -rf $GOPATH/pkg \ && unset GOROOT && unset GOPATH