Search code examples
ibm-clouddocker-compose

Running docker-compose commands inside IBM Bluemix container


I am trying to execute "docker-compose scale" command from within one of the containers on my IBM Bluemix containers. I wonder if the API of IBM containers can be used for that purpose (http://ccsapi-doc.mybluemix.net/)


Solution

  • This should be possible, but there are some caveats. Mainly - docker/compose running inside a container in general expects to have access to the docker socket, which it will not in this case (that requires privileged access to the host). To get around that, you'll need to install docker + compose + bx/cf + ic plugin and use those to login to Bluemix from inside the container, then use cf login + cf ic login (or bx...), then export the variables as displayed there.

    Once that's done, then it will be able to access the api server to make the docker/compose calls that way.