IRCD inside Docker HowTo

This HowTo is to explain how to install an IRC Server inside of a Docker Container,
for testing purposes I also installed vim (just take a look at the Dockerfile …) but it was
for testing only, you can leave it out.

1. Become root
2. Type in:
docker info (just to see if docker is installed)
if „command not found“ shows up, you have to install docker-io
3. create a new folder to store config files (to copy inside the container) and the Dockerfile
(config file for docker to build images)
mkdir -pv ~/Dockerfiles/ircd
cd ~/Dockerfiles/ircd
create an ircd.conf
(a lot of examples can be found on net, this HowTo should not show,
how to configure ircd, it should show, how to create own Docker Container)

4. create a Dockerfile
vim Dockerfile
5. inside this file, add following lines:

FROM ubuntu:latest

RUN apt-get update

RUN apt-get install -y hybserv ircd-hybrid vim

ADD ircd.conf /etc/ircd-hybrid/ircd.conf
RUN chown irc:irc /etc/ircd-hybrid/ircd.conf
RUN mkdir -p /var/run/ircd
RUN chown irc:irc /var/run/ircd
RUN sed -i s'#/var/run/ircd:/usr/sbin/nologin#/var/run/ircd:/bin/bash#g' /etc/passwd

EXPOSE 6666:6666

ENTRYPOINT su irc -c "/usr/sbin/ircd-hybrid -pidfile /var/run/ircd/ircd-hybrid.pid -foreground"

Okay short explanation:
Line 1 just define which distribution docker should download (it is a minimal continer with no service inside)
Line 3 make an update, so that you are able to install something (whithout package DB … it is not possible)
Line 5 Execute the command inside the Docker Container, in this case install ircd + vim
Line 7 Copy the previous (Step 4) created ircd.confg inside the docker container
Line 8-11 Execute some Commands inside the Container to make the IRCD  able to run
Line 13 tells docker to listen on specific ports on runtime
Line 15 Tells docker, what to execute after basic container is started

6. now we are able to build the docker container:
docker build -t torbatux/ircd:1.0 .
7. lets find out the DOCKER-ID
docker images
8. Now we can run the container:
docker run -t -d -p 6666:6666 DOCKER-ID
9. and connect with an IRC Client to Port 6666

Schreibe einen Kommentar

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.