Skip to content

Instantly share code, notes, and snippets.

@ihrwein
Created July 20, 2015 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihrwein/37a67bfebf35f1c5b796 to your computer and use it in GitHub Desktop.
Save ihrwein/37a67bfebf35f1c5b796 to your computer and use it in GitHub Desktop.
Some thoughts about our Docker images

When we started to create our own Docker images we didn't have much experience in this area. I think our current solution solves many problems but leaves one problem open: it's too complex. It it good for our first try, we learned many things from it and got a lot of useful preliminary work on our Docker images but I think we should move on.

Base images

What I expect as an user

When I try to use some software through Docker I visit Docker Hub and search for a name: syslog-ng. I don't care what's the underlying operating system I'm only interested in the software.

If I want to use a specific version I expect to work the following commands:

# this downloads the latest released syslog-ng
docker pull balabit/syslog-ng:latest
# this downloads a specific syslog-ng release
docker pull balabit/syslog-ng:3.7
docker pull balabit/syslog-ng:3.6.4

I think latest should be an alias to 3.7 (as now).

Proposal

I propose the following simplifications for the base images (when the users want to run syslog-ng in a Docker container):

  • support only one image:
  • we should decide what should be the OS we depend on (Debian Jessie, latest Ubuntu LTS, etc.),
  • name it as balabit/syslog-ng,
  • use version tags on it,
  • provide the default configuration, but give some hints how to use it with custom configs, like this:
FROM balabit/syslog-ng:3.7
COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
  • build these images from the packages in our own OBS repo,
  • I expect these requirements for incubator, too:
  • one balabit/syslog-ng-incubator image with version tags, etc...

Developer images

What I expect as a developer

If I use a Docker image as a developer I just want an environment, where I can build the source code and do some testing. I prefer to store the git repository on my host system and mount it into the Docker container. So I assume the following conditions are met:

  • developers have git and some editor installed on their host machine,
  • they expect to build and test syslog-ng in the developer images,
  • the developer tools (make, gcc, git) work the same way on every popular Linux. The point is I don't care about the underlying OS as far as I can compile and test syslog-ng without touching the OS. Nevertheless, installing some packages on a popular Linux distribution isn't so hard and a required skill for a developer. Though I know developers are touchy about their favorite Linux distribution (and text editor of course).

Proposal

  • create one development image, which contains all the developer tools to compile and test syslog-ng (git, make, gcc, etc.)
  • create some documentation about the usage of the images

Incubator:

  • it can be built atop the base image + needs the developer tools. We may set some environment variables to ease its usage (PKG_CONFIG_PATH, etc.)

Summary

I would like to see 4 images:

  • balabit/syslog-ng: syslog-ng installed
  • balabit/syslog-ng-incubator: syslog-ng + incubator are installed
  • balabit/syslog-ng-dev: dev environment with dev tools + dependencies
  • balabit/syslog-ng-incubator-dev: syslog-ng installed + dev tools + dependencies for incubator modules
@justcallmegreg
Copy link

👍
KISS: Keep it simple, stupid

A good indicator would be that a developer can start contribute to syslog-ng in 10 minutes. These concepts that @ihrwein stated above is a great way to ensure out-of-the-box usage of our Docker images.

Base image

  • should be Ubuntu 12.04 or Ubuntu 14.04
  • should contain some basic configs for destinations as a template (amqp, file, network...)

Developer image

  • development tools like gdb, valgrind should be included
  • it would be great to mount a project directory and compile that inside (like in my Vagrant env)
  • just for compile and testing (everyone likes to develop on his own devenv)

Getting started in five minutes

  • short description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment