Docker-compose --context remote up -d

I am using docker-compose 1.26.0 I am trying to use the new --context to send containers to a remote docker host.

I got the information about the new context for docker-compose here: https://www.docker.com/blog/how-to-deploy-on-remote-docker-hosts-with-docker-compose/

The command I am using is: docker-compose --context remote --verbose up -d

I am getting the following error:

docker.utils.config.find_config_file: Trying paths: ['/root/.docker/config.json', '/root/.dockercfg']
docker.utils.config.find_config_file: No config file found
ERROR: compose.cli.main.main: Context 'remote' not found

docker context ls —> This shows the context remote

docker --context remote ps —> this works as it shows the remote containers on the remote host. I can also do run from this as well and it will launch a container on the remote host.

Its only docker-compose that doesn’t work with --context

Edited to add: both systems are using docker for Linux on ubuntu 16.04. They are both fresh installs

I already reported that as a bug in docker-py library (which docker-compose uses to comunicate with Docker daemon): https://github.com/docker/docker-py/issues/2622.

As a workaroun you need to create config.json in your users ~/.docker directory. You seem to be running docker and docker-compose as root, so for you it would be /root/.docker/config.json.