[V8.0.0.4 Oct 2015]

Building a sample base IBM MQ queue manager image

In order to use IBM® MQ in Docker, you need initially to build a base image with a clean IBM MQ installation. The following steps show you how to build a sample base image, using code hosted on GitHub.

Procedure

  1. Install the prerequisite packages.
    These instructions make use of some Linux® packages that you must install.
    • On Ubuntu:
      
      sudo apt-get install python git
      
    • On Red Hat Enterprise Linux:
      
      sudo yum install python git
      
  2. Create a downloads directory by issuing the command mkdir downloads.
  3. Download the IBM MQ server for Linux image, using Passport Advantage®.
    See Installation using Electronic Software Download for more details.

    For example, select the WS_MQ_V8.0.0.4_LINUX_ON_X86_64_IM.tar.gz file, and place the file in the downloads directory that you have created.

  4. Make the IBM MQ server for Linux image (tar.gz) file available on an HTTP or FTP server.

    The reason for this is to save space in the Docker image layers. Every instruction in a Docker file causes a new image layer to be created.

    If you use the ADD or COPY instructions, followed by a RUN instruction to install, then the files added or copied will be committed to a new image layer.

    Even if you delete the file in subsequent layers, the file still exists in the previous layer. For this reason, it is good practice to download and install within a single RUN command, which means the files need to be available on the network.

    For example, you can use Python to run an HTTP server, serving all files in your current directory:
    pushd downloads
    nohup python -m SimpleHTTPServer 8000 &
    popd
    
  5. Extract the sample files, for building a supported Docker image, from GitHub by issuing the following command:
    git clone -b mq-8 https://github.com/ibm-messaging/mq-docker mq-docker
    
  6. Identify your local IP address.

    Your address is specific to your local environment, but should be available if you run the following command:

    
    ip addr show
    

    Note that localhost does not work.

  7. Edit the Docker file and change the existing entry for IBM MQ_URL to point to the file on your local file server.
    For example:
    MQ_URL=http://10.0.2.15:8000/WS_MQ_V8.0.0.4_LINUX_ON_X86_64_IM.tar.gz
    
  8. Change your directory by issuing the following command:
    cd mq-docker
    
  9. Build the base IBM MQ image by issuing the following command:.
    sudo docker build --tag mq .
    

Results

You now have a base Docker image with IBM MQ installed.