From c7a37e47692e288810a3212175632caadb5d87a3 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 10 Aug 2016 01:04:21 +0100 Subject: [PATCH 1/4] make template suitable for rebase --- template/Dockerfile | 34 +++++++------------- template/README.md | 13 +++++--- template/cron/sample_cron | 1 - template/init/sample | 5 --- template/{ => root}/defaults/sample.conf | 0 template/root/etc/cont-init.d/30-sample | 4 +++ template/root/etc/services.d/servicename/run | 3 ++ template/services/servicename/run | 2 -- 8 files changed, 28 insertions(+), 34 deletions(-) delete mode 100644 template/cron/sample_cron delete mode 100644 template/init/sample rename template/{ => root}/defaults/sample.conf (100%) create mode 100644 template/root/etc/cont-init.d/30-sample create mode 100644 template/root/etc/services.d/servicename/run delete mode 100644 template/services/servicename/run diff --git a/template/Dockerfile b/template/Dockerfile index e7e652a..bc68a68 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -1,34 +1,24 @@ -FROM linuxserver/baseimage +FROM lsiobase/alpine MAINTAINER Your Name -ARG DEBIAN_FRONTEND="noninteractive" -ENV APTLIST="packages to install and update via apt" +# install packages +RUN \ -#Applying stuff -RUN apt-get update -q && \ -apt-get install $APTLIST -qy && \ -##DO STUFF HERE +##DO STUFF HERE ## END EACH LINE WITH && \ ## EXCEPT THE LINE BELOW -apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* -#Adding Custom files -COPY init/ /etc/my_init.d/ -COPY services/ /etc/service/ -COPY cron/ /etc/cron.d/ -COPY defaults/ /defaults/ -RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh +# copy local files +COPY root/ / -# Volumes and Ports -VOLUME /volume +# ports and volumes EXPOSE PORT +VOLUME /volume ## NOTES ## -## Delete files\folders not needed, e.g. if you dont run any cron commands, delete the cron folder and the "ADD cron/ /etc/cron.d/" line. -## The User abc, should be running everything, give that permission in any case you need it. -## Use linuxserver/baseimage as often as posible (or linuxserver/baseimage.nginx/apache/python where applicable) -## When creating init's Use 10's where posible, its to allow add stuff in between when needed. also, do not be afraid to split custom code into several little ones. -## Make stuff as quiet as posible "e.g. apt-get update -qq" (Does not apply to the "app" itself. e.g. plex) +## Delete files\folders not needed +## The User abc, should be running everything, give that permission in any case you need it. +## When creating init's Use 10's where posible, its to allow add stuff in between when needed. also, do not be afraid to split custom code into several little ones. ## user abc and folders /app /config /defaults are all created by baseimage -## the first available init script is 30.sh +## the first available init script is 30 diff --git a/template/README.md b/template/README.md index 4dc0c18..c435188 100644 --- a/template/README.md +++ b/template/README.md @@ -1,5 +1,10 @@ -![https://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) + +### This is a Container in active development by the [LinuxServer.io](https://linuxserver.io) team and is not recommended for use by the general public. + +If you want to comment\contribute on this container , are looking for support on any of our other work , or are curious about us in general check out the following. + +* [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! -## This is a Container in active development, and should not be used by the general public. -If you are curious about the current progress or want to comment\contribute to this work, feel free to join us at our irc channel: -[IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` or visit our website at [https://linuxserver.io](https://www.linuxserver.io/). diff --git a/template/cron/sample_cron b/template/cron/sample_cron deleted file mode 100644 index 4d899be..0000000 --- a/template/cron/sample_cron +++ /dev/null @@ -1 +0,0 @@ -* * * * * abc /path/to/command/to/run.sh diff --git a/template/init/sample b/template/init/sample deleted file mode 100644 index 3305d6b..0000000 --- a/template/init/sample +++ /dev/null @@ -1,5 +0,0 @@ -#!/sample/file - -Do not use numbers 00,01,99 for sorting -Baseimage contains 10_add_user_abc.sh - \ No newline at end of file diff --git a/template/defaults/sample.conf b/template/root/defaults/sample.conf similarity index 100% rename from template/defaults/sample.conf rename to template/root/defaults/sample.conf diff --git a/template/root/etc/cont-init.d/30-sample b/template/root/etc/cont-init.d/30-sample new file mode 100644 index 0000000..cac6283 --- /dev/null +++ b/template/root/etc/cont-init.d/30-sample @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv bash +### above is proper shebang for image using s6 + + diff --git a/template/root/etc/services.d/servicename/run b/template/root/etc/services.d/servicename/run new file mode 100644 index 0000000..e7ea7cf --- /dev/null +++ b/template/root/etc/services.d/servicename/run @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash +exec \ + s6-setuidgid abc /command/to/execute diff --git a/template/services/servicename/run b/template/services/servicename/run deleted file mode 100644 index 926a09f..0000000 --- a/template/services/servicename/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exec /sbin/setuser abc "/command/to/execute" \ No newline at end of file From 6631ea373658b1cc2046b49654d1bb1215749a87 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 10 Aug 2016 01:06:03 +0100 Subject: [PATCH 2/4] tidy README a bit more --- template/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/README.md b/template/README.md index c435188..3c3b631 100644 --- a/template/README.md +++ b/template/README.md @@ -1,8 +1,8 @@ ![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) -### This is a Container in active development by the [LinuxServer.io](https://linuxserver.io) team and is not recommended for use by the general public. +## This is a Container in active development by the [LinuxServer.io](https://linuxserver.io) team and is not recommended for use by the general public. -If you want to comment\contribute on this container , are looking for support on any of our other work , or are curious about us in general check out the following. +If you want to comment\contribute on this container , are looking for support on any of our other work , or are curious about us in general, check out the following. * [forum.linuxserver.io](https://forum.linuxserver.io) * [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` From 4fad5a881c5abd26b1908a95c84446b5fa986428 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 10 Aug 2016 01:11:48 +0100 Subject: [PATCH 3/4] tidy up READMETEMPLATE.md --- template/READMETEMPLATE.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/template/READMETEMPLATE.md b/template/READMETEMPLATE.md index a22e04a..5671998 100644 --- a/template/READMETEMPLATE.md +++ b/template/READMETEMPLATE.md @@ -9,7 +9,7 @@ The [LinuxServer.io](https://linuxserver.io) team brings you another container r Provide a short, concise description of the application. No more than two SHORT paragraphs. Link to sources where possible and include an image illustrating your point if necessary. Point users to the original applications website, as that's the best place to get support - not here. -Our Plex container has immaculate docs so follow that if in doubt for layout. +Our Plex container has immaculate docs so follow that if in doubt for layout. ## Usage @@ -46,10 +46,9 @@ In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as bel Insert a basic user guide here to get a n00b up and running with the software inside the container. DELETE ME -## Updates +## Info * Shell access whilst the container is running: `docker exec -it container-name /bin/bash` -* Upgrade to the latest version: `docker restart container-name` * To monitor the logs of the container in realtime: `docker logs -f container-name` ## Versions From 26be5b16bfb1f3dc719485caeec819756354c4ee Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Wed, 10 Aug 2016 01:13:46 +0100 Subject: [PATCH 4/4] tidy up READMETEMPLATE.md --- template/READMETEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/template/READMETEMPLATE.md b/template/READMETEMPLATE.md index 5671998..2da5c9c 100644 --- a/template/READMETEMPLATE.md +++ b/template/READMETEMPLATE.md @@ -29,6 +29,7 @@ docker create \ * `-e PGID` for GroupID - see below for explanation * `-e PUID` for UserID - see below for explanation +It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it /bin/bash`. ### User / Group Identifiers