Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Accessing Bluemix via CLI in Docker and Cloud Foundry

DZone's Guide to

Accessing Bluemix via CLI in Docker and Cloud Foundry

For Docker you can SSH into containers with the right keys. For Cloud Foundry, things are a little more tricky, with env variables needing to be set.

· Cloud Zone
Free Resource

Production-proven Mesosphere DC/OS is now even better with GPU scheduling, pods, troubleshooting, enhanced security, and over 100+ integrated services deployed in one-click.

During the development and testing of applications it's sometimes necessary to get access to the hosts of the running applications via command line, for example if you want to check or set certain environment variables, log files, etc. Dependent on whether you run applications as Cloud Foundry applications or Docker containers, IBM Bluemix provides different mechanisms to do this.

Docker

For Docker you can SSH into containers. Read the documentation for details. Essentially you need an SSH key pair and you need to add the public key to the container. This can either be done when building the images via Dockerfile or you can use the Bluemix user interface to do this for single instance containers.



After this you can use SSH with your private key by invoking a command like ...
ssh -i /Users/nheidloff/.ssh/cloud.key root@134.168.15.124


Cloud Foundry

For Cloud Foundry based applications you need to enable the debugging features. Read the blog from my colleague Sai Vennam for details. The feature is rather hidden in the web user interface. You need to set an environment variable either via the cf (Cloud Foundry) command line interface or via the user interface.

BLUEMIX_APP_MGMT_ENABLE
devconsole+shell+inspector+trace+proxy+hc



After this you can open the management console by appending "/bluemix-debug/manage" to the URL of your app.



From the management console you can open shells and restart applications.


Simply build, test, and deploy. Mesosphere DC/OS is the best way to run containers and big data anywhere offering production-proven flexibility and reliability.

Topics:
cloud foundry ,bluemix ,docker

Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}