From c5cf4924c85c04b0bf79aff1f2a542561f1da5bd Mon Sep 17 00:00:00 2001 From: Ryan Seys Date: Sat, 16 Nov 2013 02:01:25 -0500 Subject: [PATCH 1/2] Specify -p explicitly for Docker 0.6.5+ security changes --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6577edf..746d918 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,18 @@ Run the [ZNC](http://znc.in) IRC Bouncer in a Docker container. +## Prerequisites + +1. Install [Docker](http://docker.io/). +2. Make .znc folder: `mkdir /home/$(whoami)/.znc` + + ## Running To retain your ZNC settings between runs, you will need to bind a directory from the host to `/znc-data` in the container. For example: - docker run -d -v /home/$(whoami)/.znc:/znc-data jimeh/znc + docker run -d -p 6667 -v /home/$(whoami)/.znc:/znc-data jimeh/znc This will download the image if needed, and create a default config file in your data directory unless you already have a config in place. The default @@ -19,7 +25,7 @@ exposed: Or if you want to specify which port to map the default 6667 port to: - docker run -d -p 36667:6667-v /home/$(whoami)/.znc:/znc-data jimeh/znc + docker run -d -p 36667:6667 -v /home/$(whoami)/.znc:/znc-data jimeh/znc Resulting in port 36667 on the host mapping to 6667 within the container. @@ -49,7 +55,7 @@ down ZNC's startup with a few seconds. ## Building It Yourself -1. Install Docker (http://docker.io/). -2. Checkout source: `git clone https://github.com/jimeh/docker-znc.git && cd docker-znc` +0. Follow Prerequisites above. +1. Checkout source: `git clone https://github.com/jimeh/docker-znc.git && cd docker-znc` 3. Build container: `sudo docker build -t $(whoami)/znc .` -4. Run container: `sudo docker run -d -v /home/$(whoami)/.znc:/znc-data $(whoami)/znc` +4. Run container: `sudo docker run -d -p 6667 -v /home/$(whoami)/.znc:/znc-data $(whoami)/znc` From d7ce2bf6722a9e739da1678712ba9214e27a91fe Mon Sep 17 00:00:00 2001 From: Ryan Seys Date: Sat, 16 Nov 2013 02:17:02 -0500 Subject: [PATCH 2/2] Clean up Dockerfile for readability --- Dockerfile | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8783591..207a6b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,20 @@ # version 0.0.1 -# docker-version 0.6.1 -from ubuntu:12.04 -maintainer Jim Myhrberg "contact@jimeh.me" +# docker-version 0.6.6 +FROM ubuntu:12.04 +MAINTAINER Jim Myhrberg "contact@jimeh.me" # Make sure the package repository is up to date. -run echo "deb http://archive.ubuntu.com/ubuntu precise-backports universe" >> /etc/apt/sources.list -run apt-get update - +RUN echo "deb http://archive.ubuntu.com/ubuntu precise-backports universe" >> /etc/apt/sources.list +RUN apt-get update # Let's do this... -run apt-get install -y znc/precise-backports znc-dbg/precise-backports znc-dev/precise-backports znc-extra/precise-backports znc-perl/precise-backports znc-python/precise-backports znc-tcl/precise-backports && apt-get clean +RUN apt-get install -y znc/precise-backports znc-dbg/precise-backports znc-dev/precise-backports znc-extra/precise-backports znc-perl/precise-backports znc-python/precise-backports znc-tcl/precise-backports && apt-get clean -run useradd znc -add start-znc /usr/local/bin/ -add znc.conf.default /src/ +RUN useradd znc +ADD start-znc /usr/local/bin/ +ADD znc.conf.default /src/ -user znc -expose 6667 -entrypoint ["/usr/local/bin/start-znc"] -cmd [""] +USER znc +EXPOSE 6667 +ENTRYPOINT ["/usr/local/bin/start-znc"] +CMD [""]