Laboratory to bluemix, a cloud solution exercise to etl scheduler

Archive for the tag “cloudfoundry”

Deploy a container through the command line

  1.  You can verify connection via cf ic images. This will show a list of all the images in your organization’s repository, which should be the four public IBM images so far.
        $ cf ic images
        REPOSITORY                                                            TAG                 IMAGE ID            CREATED             VIRTUAL SIZE                         latest              ef21e9d1656c        13 days ago         528.7 MB                                 latest              2209a9732f35        13 days ago         492.8 MB                                    latest              8f962f6afc9a        13 days ago         429 MB                    latest              5996bb6e51a1        13 days ago         770.4 MB
  2. You will be using the IBM Containers plug-in. You can run help for more information   $ cf ic help

  3. To create a container deploying the IBM Liberty container image again:cf ic run --name container-lab-1 -p 9080 -m 64
    • -p specifies the exposed port of the image, similar to the Ports field in Task 2, Step 9 above.When you specify a port, you are making the application available to the Bluemix Load Balancer and other containers attempting to access that port. If a port is specified in the Dockerfile for the image that you are using, include that port.For the IBM certified Liberty Server image, enter port 9080 via -p 9080.
      For the IBM certified Node.js, enter port 8000 via p 8000.
      If you plan on logging in to the container via SSH, add port 22 via -p 22.
    • --name specifies the name you can use to refer to the container
    • -m specifies the memory limit (and associated storage capacity), similar to Task 2, Step 7 above
    • is the repository name for the image as displayed by the cf ic images command
  4. To check that the container has been deployed successfully, run the cf ic ps -a command to show all the container artifacts that have been created or deployed in your organization.
        $ cf ic ps -a
        CONTAINER ID        IMAGE                                                            COMMAND             CREATED            STATUS                  PORTS                                                                                     NAMES
        a055ba5e-77b                     ""                  5 minutes ago      Running 4 minutes ago   134.XXX.YYY.ZZZ:9080->9080/tcp                                                             container-lab-1
  5. Now you can assign a public IP to the container. The cf ic run command will proactively attempt to request and bind a public IP address for your container instance if there is room left in your IP Quota. By default, you have 2 Public IP addresses in your quota.If your cf ic ps -a command returns your Liberty container with ports in the form of 134.XXX.YYY.ZZZ:9080->9080/tcp, then your container already has an assigned Public IP address and you can skip the next step.
  6. (Optional) You will first list all requested Public IP addresses and then bind an available IP address to your running container instance.
        $ cf ic ip list -a
        Number of allocated public IP addresses:  2
        IpAddress         ContainerId   
        134.XXX.YYY.174   df6ba7fd-436e-4d57-a69b-4228e19cadc1   

    Choose an IP address that is not bound to a container. Note that in Bluemix, you are allocated 2 Public IPs free of charge. If you do not have any public IP addresses available to complete the lab, use the cf ic ip release command to release one. In a real environment, contact your Bluemix organization administrator to provision additional public IP addresses for your organization.

    Once you have identified the desired IP address (selecting 134.XXX.YYY.175 from above), you run the cf ic ip bindcommand to associate a running container instance to a public IP address. The cf ic ip bind command takes either the container name or the container ID as the second argument to support scriptable interactions.

          $ cf ic ip bind 134.XXX.YYY.175 container-lab-1
          Successfully bound IP
  7. Validate access to the container through the browser. Run cf ic ps -a once again and copy the public IP address associated with your container. Enter this value into your browser via http://%5BPublic_IP_Address%5D:9080 and you should see the Welcome to Liberty landing page.
  8. Since both the UI and the CLI are working with the same backend, you can view your newly CLI-created container instance in the UI as well. This can be done by returning to the Bluemix Dashboard.
  9. Click on CONTAINERS in the left-hand menu. Your dashboard is now filtered to show your running container instances. Clicking on the square with the container-lab-1 title will take you to the container overview dashboard. From here you have access to the same Monitoring & Logging, as well as the controls available to Stop, Pause, Restart, & Delete containers.


Congratulations, you have successfully completed this IBM Containers lab! You learned how to work with IBM Containers, and deploy Docker images onto Bluemix through the UI & CLI.


If you plan to do another lab, you need to clean up your container instances. This can be done through the UI and the DELETE button on each container, or you can do this through the CLI with the cf ic rm -f [CONTAINER_NAME] command.


Bluemix Container Lab @ Windows


There are many configuration to enable Bulemix devops process. Here I show is the easiest way for lab.

  1. Install Docker@Windows
    Install Docker Toolbox
  2. Sign up for an IBM Bluemix account
  3. Install IBM Containers plugin
    Table 1. Two ways to install plugin @ Windows
    Operating system Command
    Windows 7 64-bit
    Linux 64-bit@VirtualBox


  4. Sign up for IBM Containers in IBM Bluemix
    • From the Bluemix dashboard, click Start Containers
    • You will be prompted to Set registry namespace.
    • Enter in a registry name, cannot be changed afterwards. This registry name is used across your account when using the IBM Containers service.

Read more…

Post Navigation