项目作者: codeship-library

项目描述 :
Docker images and scripts to deploy to IBM Cloud
高级语言: Dockerfile
项目地址: git://github.com/codeship-library/ibm-bluemix-utilities.git
创建时间: 2017-07-25T08:49:30Z
项目社区:https://github.com/codeship-library/ibm-bluemix-utilities

开源协议:MIT License

下载


IBM Cloud Utilities

Deployment Container

This is a generic deployment container with the IBM Cloud CLI, the CloudFoundry CLI (via the ibmcloud cf wrapper) and the Kubernetes CLI (kubectl) installed.

Please see the cloudfoundry.sh and kubernetes.sh sample scripts as starting points for your own deployment scripts.

The image is available via the codeship/ibm-bluemix-deployment repository on Docker Hub.

dockercfg Generator

Codeship supports using custom images to generate dockercfg files during the build process. To use this image to integrate with IBM Cloud Registry, simply define an entry in your services file for this image, and reference it from any steps or services which need to interact with the Bluemix Registry repositories with the dockercfg_service field. You’ll also need to provide the following environment variables using an encrypted env file:

  • BLUEMIX_API_KEY - Your IBM Cloud API key

Optionally, you can also set the following variables to assume a role across accounts before generating the dockercfg:

  • BLUEMIX_API_ENDPOINT - The API endpoint, defaults to api.ng.bluemix.net

Here is an example of using and ECR Dockercfg generator to authenticate pushing an image.

  1. # codeship-services.yml
  2. app:
  3. build:
  4. image: registry.ng.bluemix.net/your_namespace/image
  5. dockerfile_path: ./Dockerfile
  6. bluemix_dockercfg:
  7. image: codeship/ibm-bluemix-dockercfg-generator
  8. add_docker: true
  9. encrypted_env_file: bluemix.env.encrypted
  1. # codeship-steps.yml
  2. - service: app
  3. type: push
  4. tag: master
  5. image_name: registry.ng.bluemix.net/your_namespace/image
  6. registry: registry.ng.bluemix.net/
  7. dockercfg_service: bluemix_dockercfg:

You can also use this authentication to pull images, or use with caching, by defining the dockercfg_service field on groups of steps, or each individual step that pulls or pushes an image, or by adding the field to specific services.