IBM Containers on Bluemix using the CLI and existing Docker images

IBM Containers on Bluemix using the CLI and existing Docker images

In a previous post, I wrote about the top five game-changing capabilities of IBM Containers on Bluemix, and how you can get started using the Bluemix user interface. But if you’re a developer, you may want to perform the same tasks using the command line. Let’s take a look at how you can leverage the command line for IBM Containers, as well as how to work with existing Docker images.

Assuming you are already registered to use IBM Containers on Bluemix, deploying new containers can be accomplished with the following steps. Per the documentation, install Docker, Cloud Foundry CLI, Python, and IBM Containers Extension (ICE) before getting started.

  1. Log into IBM Bluemix with your Bluemix account
    1. ice login
  1. Display images available on the cloud
  1. ice images
  1. Start a container on IBM Bluemix from the Liberty image
    1. ice run --name liberty1 ibmliberty:latest
  1. Download this image to the local system
    1. ice --local pull registry-ice.ng.bluemix.net/ibmliberty:latest
  1. Start a container on the local system from the Liberty image
    1. ice --local run registry-ice.ng.bluemix.net/ibmliberty:latest

You can also move existing Docker images from your private cloud and run them with a public IP hosted in IBM Bluemix.

  1. Log into IBM Bluemix with your Bluemix account
    1. ice login
  1. Tag the local image to prepare for upload
    1. ice ---local tag ---f wordpress registry--ice.ng.bluemix.net/namespace/wordpress-live
  1. Push (upload) the image to the Bluemix hosted registry
    1. ice --local push registry-ice.ng.bluemix.net/namespace/wordpress-live
  1. Display the images available in the registry
    1. ice images
  1. Instantiate a new instance of this image, running on the IBM Bluemix cloud.
    1. ice run –name mynodeapp registry/wordpress-live:latest
  1. List running containers.
    1. ice ps
  1. Request a public IP address to ensure the container is accessible by other users.
    1. ice ip request
  1. Bind the newly acquired public IP address to the running container
    1. ip bind 1.2.3.4 <Container_ID>

Be sure to start your FREE trial today!

Now that you have seen both, do you prefer the UI or CLI? Let’s continue the discussion in the comments below, or you can reach out to me on Twitter @ChrisRosen188.

Christopher Di Dato, ex-Google, IBM, eBay, HP.

Technical Security Leader, Product Security, Cybersecurity, Cloud Security, Security Strategy. CISSP,SAFE,ITIL,MCP,HSCE

9 年

Nice work Chris!

回复
Christopher Scabora

Scabora Life & Wealth Group Inc

9 年

Great post my friend #IBMfamily #Fullthrottlerosen

回复

要查看或添加评论,请登录

Chris Rosen的更多文章

社区洞察

其他会员也浏览了