Appendix A: Deploy to Pivotal Cloud Foundry
The basic steps necessary to deploy a service that uses the VLINGO XOOM platform components to the Pivotal Cloud Foundry.
- 2.Once logged in, create a repository for each image. The field Name is the name of the docker image. This is the identifier along with the account name.
- 4.Now you are ready to push your image to DockerHub repository using
Once the script finishes, the docker image is published to DockerHub and ready to be deployed.
Docker Image Implementation
Dockerfileis implemented using MultiStage build:
- The build stage extends
FROM maven:alpine. The single responsibility of this stage is to install dependencies (caching layers) and generate the jar.
- The runtime stage extends
FROM openjdk:alpineand works executing the jar generated by build stage. It will
EXPOSEthe external ports to the host.
Now that the image is pushed to Docker Hub, push them into Pivotal Platform.
Once the Cloud Foundry CLI is installed on your machine, login to your Pivotal account:
$ cf login -a https://api.run.pivotal.io
A Cloud Foundry connection is established using your Pivotal account. Copy the
example-manifest.ymlto your project and rename it to
manifest.yml. Open the manifest file and edit the three configurable variables:
- 1.service_name: The name of the service inside the Pivotal Cloud Foundry platform.
- 2.docker_image: The docker image name is composed of your account name and the repository name (e.g: vlingo/project1)
- 3.subdomain: This is your public end-point within domain
Along with your configured
manifest.yml, push your project:
$ cf push
This command by default checks whether a
manifest.ymlexists in the directory, and if so, uses it to push to the platform.
That's all it takes! The service/application is in the Pivotal Cloud Foundry, deployed and working. Use the Pivotal Console to see your services, the logs, and any other project infrastructure artifacts.