Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 2.43 KB

docker-images-as-part-of-an-mta-deployment-754d480.md

File metadata and controls

52 lines (35 loc) · 2.43 KB

Docker Images as Part of an MTA Deployment

Deploy Docker images as part of a Multitarget application.

You can deploy your own or 3rd party Docker images in the Cloud Foundry environment by referencing them in an application module.

This type of application deployment is faster, as images are already built. Thus, staging is not required, and also all dependencies are statically included in the image.

Note:

When you reference docker images, MTA packages are not self-sustained - they depend on external repositories hosting images for the deployment.

You can deploy Docker images as MTA modules using the Cloud Foundry command line interface.

To deploy a Docker image as a Cloud Foundry application, your deployment descriptor should reference the image in a module as described in the following example:

Sample Code:

…
modules:
  name: foo
  type: application
    parameters:
      docker:
        image: cloudfoundry/test-app 
        username: <username>
        password: <password>
    build-parameters: #only required for mta.yaml
        no-source: true

… 

Using the parameters above:

  • image - you reference the location of the image so that it can be scheduled for download by the platform. You have to provide the location of the image using the format <registry.domain><:port>/repo/image:<tag>. If you don't do so, images are referenced from Docker Hub. See more about deploying an application with Docker in the provided link at the end of the section.
  • (Optional) username and password - you provide credentials in the descriptor only when the image repository requires them.
  • no-source - set this parameter to true only when creating an MTA development descriptor (mta.yaml) that is meant to be used with the Cloud MTA Build Tool.

Related Information

Cloud Foundry Documentation: Deploying an App with Docker

CF MTA Examples in GitHub: Deploying Docker Images as CF Apps with an MTA

https://hub.docker.com/

Cloud MTA Build Tool: Configuring a module that does not have source code to build and package