Get Started with Bugzilla Fast Using Docker

It is now even easier to configure and run a Bugzilla Bug Tracking System using Docker containers.

Features

  • Running latest Fedora (20)
  • Preconfigured with initial data and test product
  • Running Apache2 and MySQL Community Server 5.6
  • Openssh running via systemd so you can ssh in to the system to make changes
  • Bugzilla code resides in “/home/bugzilla/devel/htdocs/bugzilla” and can be refreshed using standard git commands
  • Docker related code can be found on github

Get started with Docker

If you are running a recent flavor of Linux such as Ubuntu or Fedora, it should be as easy installing using your respective package manager. For example with Fedora 20 you can just type

$ sudo yum install docker-io

For Mac OSX, it is a little more involved as OSX does not support the kernel features that Docker uses to create the application containers. So you will need to use VirtualBox to create a Linux VM that the containers will actually run in. More details on getting started here.

How to get it

You can download a pre-built image it from the Docker Registry and just execute it.

$ docker pull dklawren/docker-bugzilla

Or you can build it yourself from scratch and make any changes you need.

$ git clone https://github.com/dklawren/docker-bugzilla
$ cd docker-bugzilla
$ docker build -rm -t <my_name>/docker-bugzilla .

Running a new container

Since the container is using systemd to start the various services such as sshd, httpd, mysqld, etc. you will need to use “–privileged” and mount “/sys/fs/cgroup” as a read-only volume within the container.

“–privileged” is required systemd requires CAP_SYS_ADMIN capability but Docker drops that capability in the non privileged containers, in order to add more security. This means for now you have to run systemd within a privileged container since privileged containers do not drop any capabilities. This should improve in future Docker releases.

$ docker run -d -t --privileged \
    --name bugzilla \
    --hostname bugzilla \
    --publish 8080:80 \
    --publish 2222:22 \
    --volume /sys/fs/cgroup:/sys/fs/cgroup:ro \
    dklawren/docker-bugzilla

This will pull down the docker image from the Docker Registry (or run the local copy if pulled down before) and start it for you.

To stop and remove the container, you can do:

$ docker stop bugzilla
$ docker rm bugzilla

You can point your browser to http://localhost:8080/bugzilla to see the the Bugzilla home page. You can ssh into the container using

$ ssh bugzilla@localhost -p2222

The password is “bugzilla”. The above command that starts the container is also in the  “bugzilla_start.sh” file. Once the image is cache locally, starting the container should happen very quickly. You can run multiple containers but you will need to give each one a different name/hostname as well as non-conflicting ports numbers for ssh and httpd.

About these ads

About dlawrence

Currently I work mostly on Bugzilla for the Mozilla Corporation and before that I worked for many years for Red Hat, Inc. I love playing with new technologies such as Linux, mobile devices, as well as constantly trying to improve my novice programming skills.

4 responses to “Get Started with Bugzilla Fast Using Docker”

  1. gervmarkham says :

    On Ubuntu, the package is called “docker.io”. However, docker appears to only run on 64-bit OSes at the moment. For some reason which now escapes me, my Thinkpad X230 is running 32-bit Ubuntu. So no docker for me :-(

    • dlawrence says :

      Yeah. On Fedora it is called docker-io as there is already a rpm called Docker which is a desktop menubar of some kind. And yes, Docker is currently 64bit but they are working on 32bit support. Why are you not running 64bit Ubuntu on your X230. I run 64bit Fedora on my X230 and it works great.

  2. bettyqe says :

    I’ve tried to run the pre-built image with docker that is installed on Ubuntu x64, and the bugs user couldn’t login to Bugzilla URL I’ve tried with “bugs”, “bugs@my_domain” and I got the same result. Do you have some idea what is happening here? Do I lack any domain setting on my environment? :(

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: