Docker Community Forums

Share and learn in the Docker community.

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:

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):

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.