BCD controller Docker image

The BCD controller image provides a ready-to-use environment to launch Bonita Continuous Delivery CLI.

Installation

Since BCD 3.0.0, the BCD controller image is provided through Quay.io registry.

Get this image as follows:

$ docker login quay.io
Username: bonitasoft+john_doe_at_acme_com
Password:
$ docker pull quay.io/bonitasoft/bcd-controller:3.6.0

The username and the password should have been provided by your sales representative.

Usage

To enter the BCD controller environment, a Docker container has to be started on your control host using the BCD controller image.

Besides the following files have to be bind mounted from the control host to make them available to the BCD controller container:

  • /host/path/to/bonita-continuous-delivery_3.6.0 (mounted as /home/bonita/bonita-continuous-delivery) - This is known as the BCD_HOME directory.

  • Once the required files are prepared, the BCD controller container can be started in different ways described hereafter.

For linux user make sure your user id and group id is 1000 or refer to the Running BCD controller with user ID different from 1000 paragraph.

Starting a BCD controller with docker run

The first method to start a BCD Controller Docker container on the control host is to use the docker run command with BCD dependencies already present in your host, see Common installation steps.

Example:

$ docker run --rm -t -i --name bcd-controller \
    -v bcd-dependencies-:/home/bonita/bonita-continuous-delivery/dependencies/  \
    -v :/home/bonita/bonita-continuous-delivery \
    quay.io/bonitasoft/bcd-controller:3.6.0 /bin/bash

Starting a BCD controller with docker-compose run

The BCD controller container can also be created and started using Docker Compose. This method enables to configure bind mount volumes in a docker-compose.yml file instead of through command-line options.

There is an example named docker-compose.yml.EXAMPLE in your BCD_HOME directory.

If you want to use it to launch your BCD controller, you can rename this file without .EXAMPLE and adapt the paths to your environment.

Then start the BCD controller container interactively with:

$ docker-compose run --rm bcd

TIP: Persistent command history

If you want to persist your bash command history across container restarts, simply add the following environment line in your docker-compose.yaml file:

bcd:
 # lines omitted ...
 ## Add or uncomment the following lines to persist your command history across bcd controller restarts
 environment:
  - HISTFILE=/home/bonita/bonita-continuous-delivery/.bcd_bash_history

The history of your commands will be persisted to this file which is located in your project home directory.

Note for Linux users

This note refers to file permissions while bind mounting host files into the BCD controller container. This may be a concern for Linux users mainly.

The BCD controller container runs with a bonita user which has been created with uid=1000 and gid=1000.

If the user who runs the BCD controller on the control host has uid=1000 and gid=1000, then file sharing will work without any further action.
Here is how to check user and group IDs on Linux systems:

$ id
uid=1000(john) gid=1000(john) [...]

If this is not so, then read the next section to know how to fix file ownership between the control host and the controller container.

Running BCD controller with user ID different from 1000

Here is one way to remap UID/GID of the controller’s bonita user with your host user. It consists of extending the quay.io/bonitasoft/bcd-controller Docker image by using the following Dockerfile:

FROM quay.io/bonitasoft/bcd-controller:3.6.0

ARG BONITA_UID
ARG BONITA_GID

USER root

RUN groupmod -g ${BONITA_GID} bonita && \
    usermod -u ${BONITA_UID} -g ${BONITA_GID} bonita && \
    chown bonita:bonita /var/log/ansible.log

USER bonita

Build the extended BCD controller image as follows:

$ docker build -t my-company/bcd-controller:custom-uid \
    --build-arg BONITA_UID=$(id -u) --build-arg BONITA_GID=$(id -g) .

This command will produce a my-company/bcd-controller:custom-uid Docker image which can be used to run your controller container.
The bonita user will have the same UID/GID as your host user, hence solving file permission issues while sharing volumes from your host to the container.