2015-07-17 02:30:49 +02:00
<!-- [metadata]>
+++
2016-01-29 01:17:18 +01:00
title = "CLI Environment Variables"
description = "CLI Environment Variables"
2015-07-17 02:30:49 +02:00
keywords = ["fig, composition, compose, docker, orchestration, cli, reference"]
[menu.main]
parent = "smn_compose_cli"
2016-01-29 01:17:18 +01:00
weight=-1
2015-07-17 02:30:49 +02:00
+++
<![end-metadata]-->
2016-01-29 01:17:18 +01:00
# CLI Environment Variables
2015-07-17 02:30:49 +02:00
Several environment variables are available for you to configure the Docker Compose command-line behaviour.
Variables starting with `DOCKER_` are the same as those used to configure the
Docker command-line client. If you're using `docker-machine` , then the `eval "$(docker-machine env my-docker-vm)"` command should set them to their correct values. (In this example, `my-docker-vm` is the name of a machine you created.)
2016-03-11 02:29:01 +01:00
> Note: Some of these variables can also be provided using an
> [environment file](../env-file.md)
2016-01-29 01:17:18 +01:00
## COMPOSE\_PROJECT\_NAME
2015-07-17 02:30:49 +02:00
Sets the project name. This value is prepended along with the service name to the container container on start up. For example, if you project name is `myapp` and it includes two services `db` and `web` then compose starts containers named `myapp_db_1` and `myapp_web_1` respectively.
2015-10-28 17:27:14 +01:00
Setting this is optional. If you do not set this, the `COMPOSE_PROJECT_NAME`
defaults to the `basename` of the project directory. See also the `-p`
2016-02-01 18:10:21 +01:00
[command-line option ](overview.md ).
2015-07-17 02:30:49 +02:00
2016-01-29 01:17:18 +01:00
## COMPOSE\_FILE
2015-07-17 02:30:49 +02:00
2016-02-27 00:55:06 +01:00
Specify the path to a Compose file. If not provided, Compose looks for a file named
`docker-compose.yml` in the current directory and then each parent directory in
succession until a file by that name is found.
This variable supports multiple compose files separate by a path separator (on
Linux and OSX the path separator is `:` , on Windows it is `;` ). For example:
`COMPOSE_FILE=docker-compose.yml:docker-compose.prod.yml`
See also the `-f` [command-line option ](overview.md ).
2015-07-17 02:30:49 +02:00
2016-01-29 01:17:18 +01:00
## COMPOSE\_API\_VERSION
2015-09-02 22:30:09 +02:00
The Docker API only supports requests from clients which report a specific
version. If you receive a `client and server don't have same version error` using
`docker-compose` , you can workaround this error by setting this environment
variable. Set the version value to match the server version.
Setting this variable is intended as a workaround for situations where you need
to run temporarily with a mismatch between the client and server version. For
example, if you can upgrade the client but need to wait to upgrade the server.
Running with this variable set and a known mismatch does prevent some Docker
features from working properly. The exact features that fail would depend on the
Docker client and server versions. For this reason, running with this variable
set is only intended as a workaround and it is not officially supported.
If you run into problems running with this set, resolve the mismatch through
upgrade and remove this setting to see if your problems resolve before notifying
support.
2016-01-29 01:17:18 +01:00
## DOCKER\_HOST
2015-07-17 02:30:49 +02:00
Sets the URL of the `docker` daemon. As with the Docker client, defaults to `unix:///var/run/docker.sock` .
2016-01-29 01:17:18 +01:00
## DOCKER\_TLS\_VERIFY
2015-07-17 02:30:49 +02:00
When set to anything other than an empty string, enables TLS communication with
the `docker` daemon.
2016-01-29 01:17:18 +01:00
## DOCKER\_CERT\_PATH
2015-07-17 02:30:49 +02:00
Configures the path to the `ca.pem` , `cert.pem` , and `key.pem` files used for TLS verification. Defaults to `~/.docker` .
2016-01-29 01:17:18 +01:00
## COMPOSE\_HTTP\_TIMEOUT
2015-09-02 21:52:48 +02:00
Configures the time (in seconds) a request to the Docker daemon is allowed to hang before Compose considers
it failed. Defaults to 60 seconds.
2016-03-14 01:54:15 +01:00
## COMPOSE\_TLS\_VERSION
2016-06-03 20:01:20 +02:00
Configure which TLS version is used for TLS communication with the `docker`
daemon. Defaults to `TLSv1` .
Supported values are: `TLSv1` , `TLSv1_1` , `TLSv1_2` .
2015-07-17 02:30:49 +02:00
2015-10-13 13:01:19 +02:00
## Related Information
2015-07-17 02:30:49 +02:00
2015-10-13 13:01:19 +02:00
- [User guide ](../index.md )
- [Installing Compose ](../install.md )
2015-10-13 21:23:27 +02:00
- [Compose file reference ](../compose-file.md )
2016-03-11 02:29:01 +01:00
- [Environment file ](../env-file.md )