Compose: DOCKER_CONTEXT on `.env` file

Created on 16 May 2020  路  5Comments  路  Source: docker/compose

I would like use DOCKER_CONTEXT variable on .env file, until now I use DOCKER_HOST but it's more verbose. And I don't see on documentation why is not supported.

Before

.env:

DOCKER_HOST=ssh://kosssi@blue:42
COMPOSE_FILE=../../../services/traefik/docker-compose.yml
TRAEFIK_IMAGE=traefik:v2.2.1

After

.env:

DOCKER_CONTEXT=blue
COMPOSE_FILE=../../../services/traefik/docker-compose.yml
TRAEFIK_IMAGE=traefik:v2.2.1

What do you think ?

```
$ docker --version
Docker version 19.03.8, build afacb8b7f0
$ docker-compose --version
docker-compose version 1.25.5, build 8a1c60f6

kinfeature

Most helpful comment

Docker compose only started to support docker contexts in 1.26 rc4.

All 5 comments

Docker compose only started to support docker contexts in 1.26 rc4.

I reopen this issue because on 1.26.0 release it's only --context argument, I think it's cool to use also DOCKER_CONTEXT directly on .env file.

@hholst80 what do you think ?

That makes sense to me.

@kosssi I agree, though it's not limited to the .env file only.

Was this page helpful?
0 / 5 - 0 ratings