From 359bcdb184fc77df2b71e8e279759d8b40cc67dc Mon Sep 17 00:00:00 2001 From: Stian Buch Larsen Date: Mon, 24 Aug 2015 13:10:07 +0200 Subject: [PATCH] Added samples files from template --- Dockerfile | 30 +++++++++++++++++++++++++++ README.md | 7 +++++++ READMETEMPLATE.md | 45 ++++++++++++++++++++++++++++++++++++++++ cron/sample_cron | 1 + defaults/sample.conf | 1 + init/10_new_user.sh | 15 ++++++++++++++ services/servicename/run | 2 ++ 7 files changed, 101 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 READMETEMPLATE.md create mode 100644 cron/sample_cron create mode 100644 defaults/sample.conf create mode 100644 init/10_new_user.sh create mode 100644 services/servicename/run diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..38abad5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM linuxserver/baseimage +MAINTAINER Your Name + +#Applying stuff +RUN apt-get update -q && \ +##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 +RUN mkdir /defaults +ADD init/ /etc/my_init.d/ +ADD services/ /etc/service/ +ADD cron/ /etc/cron.d/ +ADD defaults/ /defaults/ +RUN chmod -v +x /etc/service/*/run && chmod -v +x /etc/my_init.d/*.sh + + +# Volumes and Ports +VOLUME /volume +EXPOSE PORT + +## 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. +## Do not upgrade the baseimage before we get a chance to look at it from a wholeheartly perspective. +## 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) diff --git a/README.md b/README.md new file mode 100644 index 0000000..8e92668 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +![http://linuxserver.io](http://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) + +## 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 out irc channel: +[IRC](http://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. + +or visit our website at [http://linuxserver.io](http://linuxserver.io) diff --git a/READMETEMPLATE.md b/READMETEMPLATE.md new file mode 100644 index 0000000..5802410 --- /dev/null +++ b/READMETEMPLATE.md @@ -0,0 +1,45 @@ +![http://linuxserver.io](http://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) + +The [LinuxServer.io](http://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](http://forum.linuxserver.io) or for real-time support our [IRC](http://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. + +# linuxserver/ + + + +## Usage + +``` +docker create --name= -v /etc/localtime:/etc/localtime:ro -v :/config -e PGID= -e PUID= -p 1234:1234 linuxserver/ +``` + +**Parameters** + +* `-p 4242` - the port(s) +* `-v /etc/localhost` for timesync - *optional* +* `-v /config` - +* `-e PGID` for GroupID - see below for explanation +* `-e PUID` for UserID - see below for explanation + +It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it quassel-core /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). + +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. + +## Setting up the application + + DELETE ME + + +## Updates + +* Upgrade to the latest version simply `docker restart `. +* To monitor the logs of the container in realtime `docker logs -f `. + + + +## Versions + ++ **dd.MM.yyyy:** This is the standard Version type now. diff --git a/cron/sample_cron b/cron/sample_cron new file mode 100644 index 0000000..4d899be --- /dev/null +++ b/cron/sample_cron @@ -0,0 +1 @@ +* * * * * abc /path/to/command/to/run.sh diff --git a/defaults/sample.conf b/defaults/sample.conf new file mode 100644 index 0000000..639bc6d --- /dev/null +++ b/defaults/sample.conf @@ -0,0 +1 @@ +placeholder config file, delete in final container diff --git a/init/10_new_user.sh b/init/10_new_user.sh new file mode 100644 index 0000000..0e50749 --- /dev/null +++ b/init/10_new_user.sh @@ -0,0 +1,15 @@ +#!/bin/bash +#This File should always be included, its the one that makes PUID and GUID Work. +# + +if [ ! "$(id -u abc)" -eq "$PUID" ]; then usermod -o -u "$PUID" abc ; fi +if [ ! "$(id -g abc)" -eq "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi +chown abc:abc -R /config +echo " +----------------------------------- +GID/UID +----------------------------------- +User uid: $(id -u abc) +User gid: $(id -g abc) +----------------------------------- +" diff --git a/services/servicename/run b/services/servicename/run new file mode 100644 index 0000000..926a09f --- /dev/null +++ b/services/servicename/run @@ -0,0 +1,2 @@ +#!/bin/bash +exec /sbin/setuser abc "/command/to/execute" \ No newline at end of file