These are the basic steps necessary to deploy a service that uses the VLINGO XOOM platform components to the Pivotal Cloud Foundry. The final section below provides a working example.
The first thing we need to do is to generate a docker image and push it to any registry. We will use the Docker Hub registry for this example.
You can use any Docker Registry that you want, either Docker Hub, any private Docker Registry, or GCR. If you want more information about how to deploy from any of these registries, check this link.
Register to Docker Hub
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.
After that, login to the registry with your docker cli by typing
docker login in your shell/terminal.
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
Dockerfile is 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:alpine and works executing the jar generated by build stage. It will
EXPOSE the external ports to the host.
Now that the image is pushed to Docker Hub, push them into Pivotal Platform.
The first requirement is to create an account in Pivotal. Obtain access to the console and then create an organization manually. It's as simple as entering input inside Create an Org.
The next step is to install the CF CLI on your computer.
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.yml to your project and rename it to
manifest.yml. Open the manifest file and edit the three configurable variables:
service_name: The name of the service inside the Pivotal Cloud Foundry platform.
docker_image: The docker image name is composed of your account name and the repository name (e.g: vlingo/project1)
subdomain: This is your public end-point within domain
You may also configure environment variables, instances, memory, disk quota, etc. See Deploying with Application Manifests for possible manifest configurations.
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.
xoom-examples for a working configuration. This demonstrates how to integrate two or more services that are deployed to the Pivotal Cloud Foundry platform. View the
xoom-http-backservice as microservices, and the
DEPLOY.md for further instructions.