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..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`. -It is based on phusion-baseimage with ssh removed, 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,15 @@ 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 -+ **14.01.2015:** Remove hardcoded loglevel from the run command, set in webui -+ **19.09.2015:** Initial Release. ++ **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/init/30_git_update.sh b/init/30_git_update.sh deleted file mode 100644 index 3662e44..0000000 --- a/init/30_git_update.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/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/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/services.d/htpcmanager/run b/root/etc/services.d/htpcmanager/run new file mode 100755 index 0000000..cf835a6 --- /dev/null +++ b/root/etc/services.d/htpcmanager/run @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv bash +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 new file mode 100755 index 0000000..8187340 --- /dev/null +++ b/root/etc/services.d/vnstat/run @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv bash + +exec \ + vnstatd -n diff --git a/services/htpcmanager/run b/services/htpcmanager/run deleted file mode 100644 index 346c706..0000000 --- a/services/htpcmanager/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -/sbin/setuser abc python /app/htpcmanager/Htpc.py --datadir /config - diff --git a/services/vnstat/run b/services/vnstat/run deleted file mode 100644 index 112633f..0000000 --- a/services/vnstat/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -vnstatd -n