Search code examples
dockercontainersibm-clouddevops

Dependent Containers and Links with IBM DevOps Services Build Pipeline


I'm currently deploying a container-based application using docker-compose. The application has a couple of components that link to dependencies (i.e. the backend links to a mongo container).

For example (docker-compose.yml):

mongo:
  container_name: backend-mongo
  image: mongo
  ports:
    - "27017"

backend:
  container_name: backend
  image: backend:production
  ports:
    - "6002:6002"
  links:
    - mongo

Has anyone found an equivalent approach when using the IBM DevOps Services (IDS) Build Pipeline and IBM Containers? I can currently only find examples of deploying standalone containers. Right now my approach would then be to manually (yuck) run the mongo containers and let IDS build & deploy the other pieces.


Solution

  • As far as I know, docker-compose is not yet supported in Bluemix Containers so you should script manually the commands from IBM DevOps Services, for example:

    cf ic run --name mysql --env MYSQL_ROOT_PASSWORD=xxx --env MYSQL_DATABASE=xxx --publish 3306 registry.eu-gb.bluemix.net/chemi/mysql
    
    cf ic run --name EmpleadoApp --publish 9080 --link mysql:mysql registry.eu-gb.bluemix.net/chemi/empleadoapp:latest
    

    Although in my example I am using a MySQL as DB and a custom app as frontend I think you can see the idea.

    You can check my Bluemix DevOps Services pipeline here: https://hub.jazz.net/pipeline/chemi/Demo4Bluemix%20%28Docker%29 You can also check interesting scripts to be used at: https://github.com/Osthanes/deployscripts