Build a Docker context

To build a Docker context, you need to use the following environment variables:

  • DOCKER_CONTEXT. The path to the Docker context to build. This path must be relative to the repository root.
  • DOCKER_LOGIN (optional). The usename used to connect to the Docker Hub in order to upload the Docker image built.
  • DOCKER_PASSWORD (optional). The usename’s password used to connect to the Docker Hub in order to upload the Docker image built.
  • DOCKER_OWNER (optional). The channel used to upload the Docker image built. If not given, it is set to the DOCKER_LOGIN value.
  • DOCKER_DEPLOY (optional). Deployment into the Docker Hub. If set to true (default if DOCKER_LOGIN is provided), the Docker image built will be deployed in the Docker Hub. If set to false (default if DOCKER_LOGIN is not provided), the Docker image built will not be deployed in the Docker Hub.
  • TRAVIS_WAIT (optional). See this page for more information.

Warning

A Docker context can only be built on the Linux OS of Travis CI.

Note

It is recommanded to define the environment variables DOCKER_LOGIN), DOCKER_PASSWORD and DOCKER_OWNER in the Settings pannel of Travis CI instead of in the .travis.yml (see this page). This is due to \(2\) major reasons:

  • These variables tends to be shared between various jobs (e.g., all jobs with a DOCKER_CONTEXT environment variable).
  • These variables tends to be overriden in forks and GitHub pull requests should not modify these values.