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.
- Log into IBM Bluemix with your Bluemix account
- ice login
- Display images available on the cloud
- ice images
- Start a container on IBM Bluemix from the Liberty image
- ice run --name liberty1 ibmliberty:latest
- Download this image to the local system
- ice --local pull registry-ice.ng.bluemix.net/ibmliberty:latest
- Start a container on the local system from the Liberty image
- 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.
- Log into IBM Bluemix with your Bluemix account
- ice login
- Tag the local image to prepare for upload
- ice ---local tag ---f wordpress registry--ice.ng.bluemix.net/namespace/wordpress-live
- Push (upload) the image to the Bluemix hosted registry
- ice --local push registry-ice.ng.bluemix.net/namespace/wordpress-live
- Display the images available in the registry
- ice images
- Instantiate a new instance of this image, running on the IBM Bluemix cloud.
- ice run –name mynodeapp registry/wordpress-live:latest
- List running containers.
- ice ps
- Request a public IP address to ensure the container is accessible by other users.
- ice ip request
- Bind the newly acquired public IP address to the running container
- 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.
Technical Security Leader, Product Security, Cybersecurity, Cloud Security, Security Strategy. CISSP,SAFE,ITIL,MCP,HSCE
9 年Nice work Chris!
Scabora Life & Wealth Group Inc
9 年Great post my friend #IBMfamily #Fullthrottlerosen