December 4, 2014 | Written by: Jason McGee
Categorized: What's New
Share this post:
As of May 23rd IBM Bluemix Container Service now provides a native Kubernetes operations experience while removing the burden of maintaining master nodes. Kubernetes itself is based on the Docker engine for managing software images and instantiating containers. Get the details.
UPDATE June 22, 2015: See IBM Delivers Docker Based Container Services for latest news.
At DockerCon Europe today we announced the availability of the beta of our new IBM container service on Bluemix. As a developer you can now leverage the power of Docker to deploy a container on Bluemix. The IBM Containers service is super easy to use. No need to deploy and manage Virtual Machines, set up Docker engine, or manage your own registries. And it is loaded with powerful capabilities.
- Native container hosting, no need to manage the docker infrastructure yourself
- Powerful networking, including support for real IP addresses on containers and private networking between your containers
- Support for private Docker image registries, allowing you to store and share your images within your Organization
- Integration with other services in Bluemix, allowing you to bind others services to your container application with ease
- Standard IBM images for WebSphere Liberty and Node.js runtime environments
- All based on standard Docker runtime and APIs
Let’s take a quick tour.
Simply log into your Bluemix account, go to the catalog and select the “IBM Containers” service.
You are allowed a single instance of the service per Organization in Bluemix. Right now for the beta you will be allowed to 2GB of memory, 2 Public IP addresses to attach to your containers, and 8 containers total. These limits will change in the future. Create the instance as normal.
Demand for the service is high right now, so once you create the service you may be placed in the queue and receive a notification like this.
Once your service instance is activated you will see the getting started screen. You will be asked to provide a name for your private Docker image registry. You will also see your API key that you will need to access the service from your command line. Make sure you have docker and the IBM Containers (ice) tools installed on your machine using the instructions provided.
Run a Container
Let’s get started and run a container. The IBM Containers service comes with images for WebSphere Liberty and Node.js. And of course you can use any image from Docker Hub. Let’s use the Liberty image to start a basic application service container. That is easy to do. Simply do the following:
> ice run --name liberty registry-ice.ng.bluemix.net/ibmliberty
This will launch your container on bluemix and give it a private IP address. Run “> ice ps” to see the running instance. You should get something like this:
In order to send a request to this container you need to give it a public IP. This is easy as well. First request a public IP address.
$ ice ip request
Successfully obtained ip: "126.96.36.199"
Now attach that IP address to your running container
$ ice ip bind 188.8.131.52 liberty
Successfully bound ip
If you run “ice ps” again you will see that the container is now accessible on the new IP address.
You can then go to that IP address to access your container.
Use a custom image
Let’s do one last thing. Let’s add an application to that WebSphere Liberty Image and run the new image. To do this we are going to build a new image using Dockerfile. To start lets pull the Liberty image to your local machine.
$ docker pull registry-ice.ng.bluemix.net/ibmliberty
Next lets create a Dockerfile with your app in it. For this example I am using a simple hello WAR file. Your Dockerfile would look something like this.
ADD hello.war /opt/ibm/wlp/usr/servers/defaultServer/dropins/
ENV LICENSE accept
Now you can build the image
$ docker build -t hello .
Now that we have our new image lets push it to your private registry on the IBM Containers service and run it. To push it do the following:
$ docker tag hello registry-ice.ng.bluemix.net//hello (replace with the private registry namespace you selected at the beginning)
$ docker push registry-ice.ng.bluemix.net//hello
Now all you have to do is run it like above and bind the IP address.
$ ice run --name hello registry-ice.ng.bluemix.net//hello
$ ice ip bind
The Service UI
In addition to the command line interface you can view the containers you are running and the images in your registry via the Bluemix UI. Simply go to the IBM Containers service tile in your Dashboard. Select the containers tab to see your running containers…
…and the Images tab to see your images.
Check back often for more information about this exciting new capability as it rapidly evolves over the coming weeks.