|
|
|
|
|
by sp332
4390 days ago
|
|
I felt like everything had to be set up outside the container, before starting it up. To get something simple like ZNC running, I had to write the config file beforehand and then add it to the dockerfile. I guess I can see how that would be useful in a big deployment. But for a one-off like this, it's much easier to boot the container, install ZNC, then edit the config. And if (when) I screwed up the config, I could just edit the file instead of rebuilding the container. |
|
Since you asked, the drawback of just logging into an image, editing files, and installing software is that you can only reproduce that image by grabbing an entire file system.
When I use Docker, I create a git repository containing a 'Dockerfile', which is basically a series of shell commands to configure a machine. I also add copies of any configuration files I'll need, and use the Dockerfile to copy them onto the machine during setup.
This can be extremely fast in practice: Docker has a caching system which "runs" unchanged lines in Dockerfile by looking up a cached VM image, so I can often edit the Dockerfile and rebuild the image in a second or so.
This approach is really nice when I have to look at an image a year later and figure out how I created it, perhaps with the goal of upgrading to a new OS release or whatever. I just glance at the Dockerfile, change the base OS version, and re-run it.