Quick Expense Manger. Your free expense manager. Lots of features. The application is also ad free.

Push Docker Image to Cloud Foundry

Posted on Aug. 4, 2018
push-docker-image-to-cloud-foundry

In this short article I will describe the steps you need to implement to push a docker image from docker hub to cloud foundry

First you need to create an account in docker hub and and push your docker image to docker hub using the below command.


docker push your-docker-hub-repository:your-docker-image


Your docker image will now be available in docker hub.


For the Cloud Foundry steps, you first need to create an account with pivotal After that you can install the cloud foundry cli from their website or if you are using Linux you can use the below command to install it.


sudo apt-get install cf-cli

Now you need to set the API end point using the below command. This will ask for your credentials and you need to enter your pivotal account details.


cf api https://api.run.pivotal.io

Now you need to set the target. If you are just doing it to test their service, you can register for free trial with pivotal web services. You will have to give your phone number and you will get a verification code.


You will then be able to create a org and space in pivotal web services. Once you create a org say your-app-org, the space named development will be created by default. You can create different space for different environments like DEV, UAT and PROD etc.


Now you will be able to set the target using the command below to push your app.


cf target -o your-app-org -s development 

Now push your image from docker hub to the development space using the command below.


cf push service-name-in-cf --docker-image your-docker-repository:your-docker-image


Cloud foundry will automatically start your application. To check the logs for your application, you can use the command below.


cf logs service-name-in-cf --recent

To check your apps in cloud foundry, you can use the below command


cf apps

Sharing is Caring!

Quick Expense Manger. Your free expense manager. Lots of features. The application is also ad free.

GET FREE UPDATES


RECOMMENDED POSTS FOR YOU


profile image

Kaushik Baruah


ABOUT

My name is Kaushik Baruah and I am the chief blogger on this Blog. I have developed this Blog from scratch using Django as the backend and here I like to share my experience as software engineer and research engineer with my online readers. I will try to focus on career planning, latest emerging technologies and tutorials on various computer science subjects. You can follow me on Twitter, Facebook and Google+

GET FREE UPDATES

POPULAR POSTS

Copyright © 2018
About Us

My name is Kaushik Baruah and I am the chief blogger on this Blog. I have developed this Blog from scratch using Django as the backend and here I like to share my experience as software engineer and research engineer with my online readers. I will try to focus on career planning, latest emerging technologies and tutorials on various computer science subjects.

Get Free Updates