Init Commit From lonix's source

This commit is contained in:
Stian Buch Larsen
2015-05-10 15:11:50 +02:00
parent 75f13135c5
commit 84f1f6c7ce
6 changed files with 85 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
FROM phusion/baseimage:0.9.15
MAINTAINER Stian Larsen <lonixx@gmail.com>
RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh
ENV DEBIAN_FRONTEND noninteractive
ENV TERM screen
# Set correct environment variables
ENV HOME /root
# Use baseimage-docker's init system
CMD ["/sbin/my_init"]
# Configure nzbdrone's apt repository
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC && \
echo "deb http://update.nzbdrone.com/repos/apt/debian master main" >> /etc/apt/sources.list && \
apt-get update -q && \
apt-get install -qy libmono-cil-dev nzbdrone && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#Ports and Volumes
VOLUME /config
VOLUME /downloads
VOLUME /tv
EXPOSE 8989
#Adding Custom files
ADD init/ /etc/my_init.d/
ADD services/ /etc/service/
RUN chmod -v +x /etc/service/*/run
RUN chmod -v +x /etc/my_init.d/*.sh
#Adduser
RUN useradd -u 911 -U -s /bin/false abc
RUN usermod -G users abc
+27
View File
@@ -0,0 +1,27 @@
# lonix/nzbdrone
**sample create command:**
```
docker create --name=<name> -v /etc/localtime:/etc/localtime:ro -v <path to data>:/config -v <path to tv>:/tv -v <path to downloads>:/downloads -e PGID=<gid> -e PUID=<uid> -p 80:80 lonix/nzbdrone:2.0
```
**You need to map**
* PORT: 8989 for Webui
* MOUNT: /downloads for downloads
* MOUNT: /etc/localhost for timesync (Not required)
* MOUNT: /config for Configuration storage
* MOUNT: /tv for tv-collection
* VARIABLE: PGID for for GroupID
* VARIABLE: PUID for for UserID
It is based on phusion-baseimage with ssh removed. (use docker exec).
**Credits**
lonix <lonixx@gmail.com>
**Versions**
2.0 gid/uid fix. and code cleanup.
1.0: Inital release
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
apt-get update -qq
apt-get --only-upgrade install -yqq nzbdrone
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
if [ -f /config/nzbdrone.pid ]; then rm -r /config/nzbdrone.pid; fi
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
if [ ! "$(id -u abc)" -eq "$PUID" ]; then usermod -u "$PUID" abc ; fi
if [ ! "$(id -g abc)" -eq "$PGID" ]; then groupmod -g "$PGID" abc ; fi
echo "
-----------------------------------
GID/UID
-----------------------------------
User uid: $(id -u abc)
User gid: $(id -g abc)
-----------------------------------
"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
exec /sbin/setuser abc mono /opt/NzbDrone/NzbDrone.exe -nobrowswer -data=/config