Docker Community Forums

Share and learn in the Docker community.

Deploy to Remote Host via Docker Contexts - Not Working

I was following this article to simplify deployment to a remote docker host via docker-compose.

While I’m able to create a context via docker as described in the article, deployment doesn’t work using docker-compose - either using the DOCKER_HOST environment variable or the --context option. I also noticed that the --context option isn’t listed in the docker-compose reference.

If I try…

docker-compose --context mycontext up -d

…it just spits back the usage info; and if I try…

DOCKER_HOST=ssh://user@000.000.000.000 docker-compose up -d

…I get a traceback with a “[18019] Failed to execute script docker-compose” message.

Anyone have any insights or suggestions?

1 Like

What version of docker-compose are you using? Contexts are available starting with 1.26.0-rc2 as mentioned in the article you are quoting.

As for connection to Docker daemon over SSH, I think it requires at least Docker 18.09 - both client and server.

Yeah, thanks. I guess I overlooked that. The version of Compose in Docker Desktop for Mac is 1.25.5, so that explains it.