Update: It’s now even easier! In 3 easy steps, you can use the Containers Service in IBM Bluemix to quickly get an IBM Integration Bus docker environment up and running; in less time than it takes to make a cup of tea!
This article describes how you can quickly get an IBM Integration Bus environment up and running within a Docker container¬†running¬†in the IBM Bluemix hosted cloud environment. ¬†If you follow the process outlined below, it shouldn’t take you any longer than about 15 minutes to get everything running! ¬†Since going on quite a dramatic diet in the lead up to the release of version 10 (March 2015), IBM Integration Bus now has a very small runtime footprint compared to many traditional enterprise IT stacks, such as application servers or databases. ¬†The “single package” zipped download file of IIBv10, which includes both the Eclipse based toolkit and also the runtime component, is approximately 1.2GB. Once installation is complete, the runtime server directory accounts for approximately 700MB on Windows for example. ¬†This small size, and zero mandatory pre-requisite products, makes it perfectly possible to easily build and run an IIB Docker image. ¬†To help users get started, a few months ago we published a Dockerfile on Github for the purpose of building such an image. ¬†You can do this on a laptop or desktop server, but with cloud based solutions becoming increasingly popular, this article provides a simple step-by-step guide for how to build and run IIB using Docker in IBM Bluemix. The whole process shouldn’t take any more than about 15 minutes to complete, so before you’re tempted to browse elsewhere let’s get cracking!
- If you’re completely new to these technologies, then you should begin by creating a free Bluemix Account, and within your organization, create a new space. ¬†In Bluemix you can use organizations and spaces to enable collaboration among users, and to help group together resources. ¬†You can manage access on a per-user basis. ¬†More information on these aspects can be found here. ¬†When you log in to your Bluemix dashboard, the icon in the top right corner allows you to manage your organizations. ¬†The rest of this article assumes you are using the US South Region of Bluemix. ¬†The Containers service on Bluemix has been available in this Region since June, and has just been made available in the London data center. ¬†So depending on your settings, you may need to change Region to get yourself access:In the example shown, I’ve chosen to use a space named IIB:
- In order to get IIB running on the Bluemix Container Service, we will be building an IIB Docker image. ¬†This requires you to have a Docker environment in which to run the build. ¬†Developers wishing to explore Docker will frequently turn to a Linux Operating System or virtual machine environment to accomplish this. Browsing through any¬†simple introduction to Docker¬†will help explain this background, but to try and keep this article accessible to the widest group of readers possible, let’s focus on Windows. ¬†First you’ll need to prepare your system to build the image. ¬†At the time of writing (October 2015), you can download and install Docker v1.8.1 on Windows 64-bit from here. ¬†Create a build directory on your file system and copy in the download of docker-1.8.1.exe (add this to your PATH, or if you’re after a quick solution just rename the file to docker.exe). ¬†Second, you will need to install the Cloud Foundry CLI (version 6.11.3) from GitHub. ¬†In a moment we’ll also install the IBM Containers Cloud Foundry plugin, but we’ll show this from the command line. ¬†The last preparation step required for building the image is to get hold of a Dockerfile (and its associated scripts). ¬†Unrelated to the Containers service, we have already published some scripts which can be used to build an IIB Docker imag. ¬†Check out this project on Github¬†to find out more. For convenience, a¬†zip file is attached¬†to this article which contains a dockerfile and 4 associated shell scripts which works in the context of this example on the Containers Service. ¬†These scripts are very similar to those you will find on Github (the Dockerfile and iib_manage.sh have been editted slightly with regard to their usage of the root id, and to avoid packaging the IIB tooling into the Docker image). ¬†If you choose to locate all these components in one place, then the contents of your build directory (for example C:\Build) should end up looking like this:
- Open a command prompt window, navigate to the build directory (in this example on Windows, we have used C:\Build) and install the IBM Containers Cloud Foundry plugin:
- Next, you need to log in to Bluemix. The -u parameter should be set to your IBM ID, and the -o parameter should be set to your organisation name (typically this will be the same value). ¬†The -s parameter is the name of the space which you defined in step 1:
- Now log in to the IBM Containers Service. ¬†Don’t be concerned by the message about the local Docker daemon not running. ¬†By default at this point the docker command will expect a local daemon (hence the warning shown above), so we need to point to the containers service as the Docker host. To fix this, you need to set some environment variables to direct to the cloud: DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY. The path on your system may be different (you should be able to refer to the responses to your cf ic login command for help with this) but the values required on your system should look a bit like this:
- You can now build the image. ¬†The command below creates an image named and tagged using the -t parameter. ¬†The period character at the end of the command directs the docker build to the current directory in order to locate the Docker file.¬†The process of building the image should take about 5 minutes to complete, so now might be a good time to grab a quick cup of tea!Once the build process completes, you should be able to list the docker images and the one you have just built and tagged should be included:
- You should now be able to return to your web browser and see the docker image which you have built (named iibdemo) in the Catalog view:
- Click on iibdemo and you can then use the image to start up a container. Choose a container name, select a size for the container and choose to Request and Bind a Public IP address for the container when it starts up. ¬†You will also need to expand the Advanced Options and set an Environment variable named LICENSE to the value “accept”. ¬†This manual step is an acknowledgement that you accept the terms of the IIB Developer edition license. ¬†If you don’t set this variable then the container will not start. ¬†Finally hit the CREATE button in the bottom right corner of the view:
- After a short wait, you should be shown a view of the running container:
- A node named IIBV10NODE should have been created for you within the container, so you should now be able to point your web browser at the IIB Web UI. ¬†IIBV10NODE should be listening on port 9080, so construct the URL based on this port and the Public IP address which was assigned to the container. ¬†In this example, this would be http://188.8.131.52:9080. ¬†The picture below shows the IIB Web UI successfully connected:
This concludes our very brief exploration of how to get IBM Integration Bus up and running inside Docker using the IBM Container service on Bluemix.[I’d like to thank Ashley Fernandez from the IBM Australia team for his joint collaboration on constructing this post!]