IBM Containers on Bluemix QuickStart
JakeKitchener 060000FD9X Visits (24228)
IMPORTANT NOTE! This article was published based on the first experimental release of the IBM Bluemix Containers service. There is now a new release in Beta of the service. The article below is no longer applicable. I will be publishing an updated article VERY soon with more information on the new service.
I can't even begin to tell you how exciting it is to have IBM Containers live now! I've been working with this project for the past few months and it's exciting to see it come to life! If you haven't check it out already you should read over Jason McGee's post. It also happens to include a great overview video from Brian Martin as well. Last quick link, if you haven't signed up already, you can get access to IBM Containers at http
OK! Let's get to the good stuff. I've been tinkering around quite a bit and you can see all kinds of great info in the docs on Bluemix for IBM Containers, but I thought it might be useful to do a little blog post that reviews just how easy it is to get started with a simple nginx container from Docker Hub. For this work I chose to use the ngin
To get started you will need your API key and registry URL from the Bluemix dashboard, and the IBM Containers CLI. Note that I try to keep this post up to date, but there may be a newer version of the CLI, so check the IBM Containers docs on Bluemix for the latest.
To install simply run:
pip install icecli-1.0.zip
Next you will need to log in with your API key using
ice login -k <api key>
Here comes the fun part. First lets pull the nginx image to our laptop
ice --local pull nginx
As a note, when we run ice --local we are running the ice cli against the local docker, note that we could also use the standard docker commands directly. No difference.
Now lets build a new image from this standard nginx image. First create a Dockerfile with these contents:
FROM nginx COPY ./html /usr
Note that in my local directory I have an html folder with index.html in it.
All set! Now let's build our new image!
ice --local build -t nginx-hello .
Now lets test it locally by starting the container and testing nginx. You can start your new image with
ice --local run -d -p 8080:80 nginx-hello
It's alive!!! OK, now let's run this little guy on IBM Containers! First we'll tag and push our image to IBM Containers:
ice --local tag nginx-hello regi
Victory! Let's run this sucker and give it a public IP address on IBM Containers
ice run --name hello regi
We're done! Our simple nginx server is now running publicly on IBM Containers!
I hope this was helpful in getting started with IBM Containers. PLEASE reach out to me on twitter @kitch or shoot me an email firstname.lastname@example.org if you have any questions.