summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2015-01-13 21:19:00 -0800
committerJesse Morgan <jesse@jesterpm.net>2015-01-13 21:19:00 -0800
commit58e201ed998b3eb5807d81ac27b50e7be6cc2e3a (patch)
treede85aa2bc103eb70bec86d95e694f8bb21420440
parent87db935887820aad472fc8016684f7d125da47f9 (diff)
Adding InspIRCd Dockerfile.HEADmaster
-rw-r--r--.dockerignore2
-rw-r--r--Dockerfile17
-rw-r--r--README.md38
-rw-r--r--build/Dockerfile11
-rwxr-xr-xbuild/build-inner.sh12
-rwxr-xr-xbuild/build.sh33
6 files changed, 113 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..04c6da6
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,2 @@
+.git
+build
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..38491cd
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,17 @@
+FROM debian:jessie
+
+RUN apt-get update && apt-get -y install \
+ libgnutls-deb0-28 \
+ gnutls-bin
+
+COPY inspircd /inspircd
+RUN useradd ircd
+RUN chown -R ircd /inspircd/data /inspircd/logs
+
+VOLUME [ "/inspircd/conf", "/inspircd/logs" ]
+
+EXPOSE 6664
+EXPOSE 6667
+EXPOSE 6697
+
+CMD [ "/bin/su", "-m", "ircd", "-c", "/inspircd/inspircd start --nofork" ]
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..839cd34
--- /dev/null
+++ b/README.md
@@ -0,0 +1,38 @@
+Docker InspIRCd
+===============
+
+These Dockerfiles build a container housing InspIRCd. The current version
+is 2.0.18.
+
+This repository is split into two Dockerfiles. The first, in the build/
+directory, builds the image for the build environment. That image is
+tagged inspircd-build and pulls in build-essentials.
+
+The second Dockerfile is in the root of the repository. It uses the
+InspIRCd binary built in the build environment to create an image without
+build-essentials.
+
+To use this image you will need to populate the /inspircd/conf directory
+with configuration files. There are two ways to do this:
+
+1. Bind a conf/ directory from the host machine
+
+ docker run -v /my/conf:/inspircd/conf -p 6667 insomniairc/inspircd
+
+2. Create your own image using insomniairc/inspircd as a base. For an
+ example, see [insomniairc/insomniaircd][insomniaircd]
+
+[insomniaircd]: https://github.com/insomniairc/insomniaircd
+
+
+Building
+--------
+
+Follow the steps below to build the image with the latest InspIRCd.
+
+1. Update build/build.sh to download the latest version.
+2. Run `./build/build.sh`
+3. Run `docker build -t inspircd .`
+
+The build script will download and compile the latest InspIRCd in the
+build environment.
diff --git a/build/Dockerfile b/build/Dockerfile
new file mode 100644
index 0000000..432972e
--- /dev/null
+++ b/build/Dockerfile
@@ -0,0 +1,11 @@
+FROM debian:jessie
+
+RUN apt-get update && apt-get -y install \
+ libgnutls28-dev \
+ gnutls-bin \
+ pkg-config \
+ build-essential
+
+RUN useradd ircd
+RUN mkdir /inspircd
+COPY build-inner.sh /build-inner.sh
diff --git a/build/build-inner.sh b/build/build-inner.sh
new file mode 100755
index 0000000..84f1835
--- /dev/null
+++ b/build/build-inner.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd /inspircd-build
+
+./configure \
+ --disable-interactive \
+ --enable-gnutls \
+ --enable-epoll \
+ --prefix=/inspircd
+
+make
+make INSTUID=ircd install
diff --git a/build/build.sh b/build/build.sh
new file mode 100755
index 0000000..1f9fa9a
--- /dev/null
+++ b/build/build.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+INSPIRCD_VERSION=2.0.18
+URL="https://github.com/inspircd/inspircd/archive/v${INSPIRCD_VERSION}.tar.gz"
+
+cd "$( dirname "$0" )"
+
+# Build build environment
+echo "Building inspircd-build image."
+docker build -t "inspircd-build" .
+
+# Get source
+if [ ! -d "inspircd-${INSPIRCD_VERSION}" ]; then
+ echo "Downloading InspIRCd"
+ wget $URL
+ tar xzf "v${INSPIRCD_VERSION}.tar.gz"
+fi
+
+rm -rf ../inspircd && mkdir ../inspircd
+
+# Start build environment
+echo "Starting build..."
+docker run \
+ -v $(pwd)/inspircd-${INSPIRCD_VERSION}:/inspircd-build \
+ -v $(pwd)/../inspircd:/inspircd \
+ inspircd-build \
+ /build-inner.sh
+
+echo "\n***********************************************************************"
+echo "Build Complete!"
+echo "You may now build the inspircd image moving to the root of the"
+echo "repository and runng and running:\n"
+echo " docker build -t inspircd .\n"