Services can have API roles. An API role is a set of privileges granted to the service containers to access the Docker Cloud API. They will receive a token through an environment variable which can be used to query the Docker Cloud API.
At the moment, we only support a “global” role which allows any operation to be performed on the API if granted. The API role is passed in to the service containers as an authorization token stored in an environment variable called DOCKERCLOUD_AUTH. This variable should be use to set the Authorization HTTP header when calling Docker Cloud’s API:
Using this feature, and combined with Docker Cloud’s automatic environment variables, you can make your application inside a container read and perform operations using Docker Cloud’s API: