@@ -7,16 +7,15 @@ Run the [ZNC][] IRC Bouncer in a Docker container.
7
7
## Prerequisites
8
8
9
9
1 . Install [ Docker] [ ] .
10
- 2 . Make .znc folder: ` mkdir $HOME/.znc `
11
10
12
- [ Docker ] : http://docker.io /
11
+ [ Docker ] : http://docker.com /
13
12
14
13
## Running
15
14
16
- To retain your ZNC settings between runs, you'll most likely want to
17
- bind a directory from the host to ` /znc-data ` in the container. For
18
- example:
15
+ ZNC needs to store settings somewhere, so simplest way to run it is to mount a
16
+ directory from the host machine to ` /znc-data ` in the container:
19
17
18
+ mkdir -p $HOME/.znc
20
19
docker run -d -p 6667 -v $HOME/.znc:/znc-data jimeh/znc
21
20
22
21
This will download the image if needed, and create a default config file in
@@ -32,8 +31,7 @@ Or if you want to specify which port to map the default 6667 port to:
32
31
33
32
Resulting in port 36667 on the host mapping to 6667 within the container.
34
33
35
-
36
- ## Configuring
34
+ ## Configuring ZNC
37
35
38
36
If you've let the container create a default config for you, the default
39
37
username/password combination is ` admin ` /` admin ` . You can access the
@@ -47,7 +45,6 @@ I'd recommend you create your own user by cloning the admin user, then ensure
47
45
your new cloned user is set to be an admin user. Once you login with your new
48
46
user go ahead and delete the default admin user.
49
47
50
-
51
48
## External Modules
52
49
53
50
If you need to use external modules, simply place the original ` *.cpp ` source
@@ -59,19 +56,40 @@ This ensures that you can easily add new external modules to your znc
59
56
configuration without having to worry about building them. And it only slows
60
57
down ZNC's startup with a few seconds.
61
58
59
+ ## DATADIR
60
+
61
+ ZNC stores all it's settings in a Docker volume mounted to ` /znc-data ` inside
62
+ the container.
63
+
64
+ ### Mount a Host Directory
65
+
66
+ The simplest approach is typically to mount a directory off of your host machine
67
+ into the container. This is done with ` -v $HOME/.znc:/znc-data ` like in the
68
+ example above.
69
+
70
+ One issue with this though is that ZNC needs to run as it's own user within the
71
+ container, the directory will have it's ownership changed to UID 1000 (user) and
72
+ GID 1000 (group). Meaning after the first run, you might need root access to
73
+ manually modify the data directory.
74
+
75
+ ### Use a Volume Container
76
+
77
+ First we need to create a volume container:
78
+
79
+ docker run -v /znc-data --name znc-data busybox echo "data for znc"
80
+
81
+ And then run the znc container using the ` --volumes-from ` option instead of
82
+ ` -v ` :
83
+
84
+ docker run -d -p 6667 --name znc --volumes-from znc-data jimeh/znc
62
85
63
- ## Notes on DATADIR
86
+ You'll want to periodically back up your znc data to the host:
64
87
65
- ZNC needs a data/config directory to run. Within the container it uses
66
- ` /znc-data ` , so to retain this data when shutting down a container, you should
67
- mount a directory from the host. Hence ` -v $HOME/.znc:/znc-data ` is part of
68
- the instructions above.
88
+ docker run --volumes-from znc-data -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /znc-data
69
89
70
- As ZNC needs to run as it's own user within the container, the directory will
71
- have it's ownership changed to UID 1000 (user) and GID 1000 (group). Meaning
72
- after the first run, you might need root access to manually modify the data
73
- directory.
90
+ And restore them later:
74
91
92
+ docker run --volumes-from znc-data -v $(pwd):/backup busybox tar xvf /backup/backup.tar
75
93
76
94
## Passing Custom Arguments to ZNC
77
95
@@ -92,16 +110,17 @@ simply run in the background.
92
110
93
111
Starting with version 1.6, ZNC now requires ssl/tls certificate verification!
94
112
This means that it will * not* connect to your IRC server(s) if they don't
95
- present a valid certificate. This is meant to help keep you safer from
96
- MitM attacks.
113
+ present a valid certificate. This is meant to help keep you safer from MitM
114
+ attacks.
97
115
98
116
This image installs the debian/ubuntu ` ca-certificates `
99
- [ package] ( http://packages.ubuntu.com/vivid/ca-certificates ) so that servers
100
- with valid certificates will automatically be connected to ensuring no additional
101
- user intervention needed. If one of your servers doesn't have a valid fingerprint,
102
- you will need to connect to your bouncer and respond to ` *status ` .
117
+ [ package] ( http://packages.ubuntu.com/vivid/ca-certificates ) so that servers with
118
+ valid certificates will automatically be connected to ensuring no additional
119
+ user intervention needed. If one of your servers doesn't have a valid
120
+ fingerprint, you will need to connect to your bouncer and respond to ` *status ` .
103
121
104
- See [ this] ( https://mikaela.info/english/2015/02/24/znc160-ssl.html ) article for more information.
122
+ See [ this] ( https://mikaela.info/english/2015/02/24/znc160-ssl.html ) article for
123
+ more information.
105
124
106
125
## Building It Yourself
107
126
0 commit comments