kitura2

In a previous blog post, I covered the steps for creating an IBM Container on Bluemix that hosts the Swift HelloWorld sample application. This time, I thought I would go over the steps for creating an IBM Container that hosts the Kitura-Starter application.

ibm_container

For those who are not familiar with Kitura, it is a lightweight web framework that you can use for building web services with complex routes. A lot of its design was inspired by Express.js (a Node.js module), given the success and high adoption rate that it’s had since its launch.

If you have not read the 10 Steps To Running a Swift App in an IBM Container blog post, now it’s a good time to go over it. Especially, make sure you cover steps 1 through 5 before attempting the following steps.

Once you have set up and configured your Cloud Foundry command line and the IBM Containers plugin as described here, you should push a copy of the ibmcom/kitura-ubuntu image to your Bluemix account. The ibmcom/kitura-ubuntu Docker image extends the ibmcom/swift-ubuntu image by adding the Kitura-Starter sample application. The contents of the Dockerfile for the ibmcom/kitura-ubuntu image can be found here.

To download the ibmcom/kitura-ubuntu image from Docker Hub and push it to your Bluemix account, you can use the following command:

$ cf ic cpi ibmcom/kitura-ubuntu:latest <bluemix registry>/<namespace>/kitura-ubuntu

Please note that you should replace <namespace> with the namespace assigned to your organization and <bluemix registry> with the name of the registry for your Bluemix region. For instance, for the US South region, the name of the registry is registry.ng.bluemix.net. Depending on your network connection, this step may take several minutes.

To access an IBM Container, a public IP address must be assigned to it and you can easily request one using the cf ic ip request command.

We are now ready to create an IBM Container named kitura-container that hosts the Kitura-Starter application by executing one simple command:

$ cf ic run -p <ip_address>:8080:8080 --name kitura-container <bluemix registry>/<namespace>/kitura-ubuntu

You should replace <ip_address>, <bluemix registry>, and <namespace> with the corresponding values.

That’s it! You should now have an IBM Container that runs the Kitura-Starter application. If you access your dashboard on Bluemix, you should see an entry for the kitura-container you just created. You can click that entry to verify that the IBM Container is up and running the Kitura sample application. You can also use your browser to test that the Kitura sample application is running by going to http://<ip_address>:8080, where <ip_address> is the IP address assigned to your IBM Container. The “You’re running Kitura” message should be displayed on your browser.

Our team is actively working on adding more functionality and capabiltiies to the Kitura web framework. If you’d like to parcitipate and contribute to this effort, please do so! Our code is open source and we welcome contributions from developers who are passionate about the Swift language, server side development, and quality. Also, we plan to implement Swift packages that will allow integrations with middleware software and Bluemix services. Stay tuned for updates!

Ricardo Olivieri, Senior Software Engineer, IBM Swift Engineering at IBM Cloud

3 comments on"Running Kitura in an IBM Container"

  1. I had a connected-topic question.
    When I was trying to run kitura on a Could Foundary buildpack for Swift, I am running into ‘Dispath’ module not found errors. So, seems like swift-corelibs-libdispatch module is not installed.
    Is there a plan to include that module in the next Swift Buildpack update. Or is there anyway I can install it myself.

    And by the way.. really nice and useful article 🙂

    • Ricardo Olivieri March 05, 2016

      Hello, thanks for stopping by! We are aware of that issue and one of our next milestones is to be able to use the CF buildpack for Swift to push Kitura to Bluemix. The swift-corelibs-libdispatch library should become part of the Swift binaries (for ubuntu) at some point. Having said that, libdispatch is not the only system level dependency Kitura has at the moment. For now, the fastest path to get Kitura running on Bluemix is to use an IBM Container as described in this blog post.

  2. Robert Brown November 07, 2016

    Same errors as I reported on errors being reported on the container image 10 Steps To Running a Swift App in an IBM Container
    while running in Bluemix. This does not keep the page from displaying.
    1. Policy violation Failed
    Image has installed packages with known vulnerabilities
    2. Vulnerable Packages ibcurl3-gnutls, libcurl3 Corrective Action Upgrade libcurl3-gnutls to at least version 7.35.0-1ubuntu2.10, Upgrade libcurl3 to at least version 7.35.0-1ubuntu2.10
    3. Valneable Package libdbus-1-3
    3116-1
    Several security issues were fixed in DBus.
    Corrective Action Upgrade libdbus-1-3 to at least version 1.6.18-0ubuntu4.4
    5. Security Violations sysctl
    /etc/sysctl.conf
    No
    /etc/sysctl.conf containing many parameters that affect system.
    /etc/sysctl.conf does not exist per rule.
    No value

Join The Discussion

Your email address will not be published. Required fields are marked *