From 9e0affe5b566a12dcaa6006ff7add3ef72c52492 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Thu, 30 Jun 2016 14:06:44 +0100 Subject: [PATCH 1/2] rebase to alpine --- Dockerfile | 29 ++++--------------- README.md | 7 +++-- .../etc/cont-init.d/30-update | 2 +- root/etc/services.d/htpcmanager/run | 2 ++ root/etc/services.d/vnstat/run | 2 ++ services/htpcmanager/run | 3 -- services/vnstat/run | 3 -- 7 files changed, 15 insertions(+), 33 deletions(-) mode change 100644 => 100755 Dockerfile rename init/30_git_update.sh => root/etc/cont-init.d/30-update (89%) mode change 100644 => 100755 create mode 100755 root/etc/services.d/htpcmanager/run create mode 100755 root/etc/services.d/vnstat/run delete mode 100644 services/htpcmanager/run delete mode 100644 services/vnstat/run diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 index 3674240..beaa262 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,9 @@ -FROM linuxserver/baseimage.python +FROM lsiobase/alpine.python +MAINTAINER sparklyballs -MAINTAINER Sparklyballs +# add local files +COPY root/ / -ENV APTLIST="libfreetype6-dev libjpeg8-dev libopenjpeg-dev libpng-dev libwebp-dev vnstat zlib1g-dev" - -# install packages -RUN apt-get update -q && \ -apt-get install \ -$APTLIST -qy && \ - -# install pip packages -pip install -U pillow && \ -pip install -U paramiko && \ -pip install -U psutil && \ -apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* - -#Adding Custom files -ADD init/ /etc/my_init.d/ -ADD services/ /etc/service/ -RUN chmod -v +x /etc/service/*/run && chmod -v +x /etc/my_init.d/*.sh - -# Volumes and Ports -VOLUME /config +# ports and volumes EXPOSE 8085 - +VOLUME /config diff --git a/README.md b/README.md index bdce240..c4b82ff 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ docker create --name=htpcmanager -v /etc/localtime:/etc/localtime:ro -v Date: Mon, 8 Aug 2016 10:59:22 +0100 Subject: [PATCH 2/2] remove git update on startup, tidy readme, init and services files --- README.md | 32 ++++++++++++++++++++--------- root/etc/cont-init.d/30-install | 9 ++++++++ root/etc/cont-init.d/30-update | 11 ---------- root/etc/services.d/htpcmanager/run | 4 +++- root/etc/services.d/vnstat/run | 4 +++- 5 files changed, 37 insertions(+), 23 deletions(-) create mode 100755 root/etc/cont-init.d/30-install delete mode 100755 root/etc/cont-init.d/30-update diff --git a/README.md b/README.md index c4b82ff..3cfdcca 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ -![http://linuxserver.io](http://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) +![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) -The [LinuxServer.io](https://www.linuxserver.io/) team brings you another quality container release featuring auto-update on startup, easy user mapping and community support. Be sure to checkout our [forums](https://forum.linuxserver.io/index.php) or for real-time support our [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. +The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring easy user mapping and community support. Find us for support at: +* [forum.linuxserver.io](https://forum.linuxserver.io) +* [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` +* [Podcast](https://www.linuxserver.io/index.php/category/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! # linuxserver/htpcmanager @@ -9,25 +12,35 @@ Htpcmanager, a front end for many htpc related applications. Hellowlol version.[ ## Usage ``` -docker create --name=htpcmanager -v /etc/localtime:/etc/localtime:ro -v :/config -e PGID= -e PUID= -p 8085:8085 linuxserver/htpcmanager +docker create --name=htpcmanager \ +-v :/config \ +-e PGID= -e PUID= \ +-e TZ= \ +-p 8085:8085 \ +linuxserver/htpcmanager ``` **Parameters** * `-p 8085` - the port(s) -* `-v /etc/localtime` for timesync - *optional* * `-v /config` - where htpcmanager should store its configuration files. * `-e PGID` for GroupID - see below for explanation * `-e PUID` for UserID - see below for explanation - +* `-e TZ` for timezone information, eg Europe/London It is based on alpine-linux with s6 overlay, for shell access whilst the container is running do `docker exec -it htpcmanager /bin/bash`. + ### User / Group Identifiers -**TL;DR** - The `PGID` and `PUID` values set the user / group you'd like your container to 'run as' to the host OS. This can be a user you've created or even root (not recommended). +Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™. -Part of what makes our containers work so well is by allowing you to specify your own `PUID` and `PGID`. This avoids nasty permissions errors with relation to data volumes (`-v` flags). When an application is installed on the host OS it is normally added to the common group called users, Docker apps due to the nature of the technology can't be added to this group. So we added this feature to let you easily choose when running your containers. +In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below: + +``` + $ id + uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) +``` ## Setting up the application @@ -35,15 +48,14 @@ The webui is found at port 8085. Smartmontools has not been included, you can safely ignore the warning error in the log. -## Updates +## Info -* Upgrade to the latest version simply `docker restart htpcmanager`. * To monitor the logs of the container in realtime `docker logs -f htpcmanager`. ## Versions -+ **30.06.16:** Rebase to alpine for smaller image size ++ **08.08.16:** Rebase to alpine linux. + **14.01.15:** Remove hardcoded loglevel from the run command, set in webui + **19.09.15:** Initial Release. diff --git a/root/etc/cont-init.d/30-install b/root/etc/cont-init.d/30-install new file mode 100755 index 0000000..217bf62 --- /dev/null +++ b/root/etc/cont-init.d/30-install @@ -0,0 +1,9 @@ +#!/usr/bin/with-contenv bash + +# install app +[[ ! -d /app/htpcmanager/.git ]] && \ + git clone https://github.com/Hellowlol/HTPC-Manager.git /app/htpcmanager + +# permissions +chown -R abc:abc \ + /app diff --git a/root/etc/cont-init.d/30-update b/root/etc/cont-init.d/30-update deleted file mode 100755 index ce347dd..0000000 --- a/root/etc/cont-init.d/30-update +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/with-contenv bash - -[[ ! -d /app/htpcmanager/.git ]] && (git clone https://github.com/Hellowlol/HTPC-Manager.git /app/htpcmanager && \ -chown -R abc:abc /app) - -# opt out for autoupdates -[ "$ADVANCED_DISABLEUPDATES" ] && exit 0 - -cd /app/htpcmanager -git pull -chown -R abc:abc /app diff --git a/root/etc/services.d/htpcmanager/run b/root/etc/services.d/htpcmanager/run index 7149246..cf835a6 100755 --- a/root/etc/services.d/htpcmanager/run +++ b/root/etc/services.d/htpcmanager/run @@ -1,2 +1,4 @@ #!/usr/bin/with-contenv bash -exec s6-setuidgid abc python /app/htpcmanager/Htpc.py --datadir /config +exec \ + s6-setuidgid abc python /app/htpcmanager/Htpc.py \ + --datadir /config diff --git a/root/etc/services.d/vnstat/run b/root/etc/services.d/vnstat/run index 2fd8da7..8187340 100755 --- a/root/etc/services.d/vnstat/run +++ b/root/etc/services.d/vnstat/run @@ -1,2 +1,4 @@ #!/usr/bin/with-contenv bash -vnstatd -n + +exec \ + vnstatd -n