Docker Community Forums

Share and learn in the Docker community.

Compose not behaving nicely with --context flag with a ssh host

Hi to everyone!
I’m having some problem using docker-compose with the --context flag, in particular when using a ssh context.
The problem derives from ssh multiplexing:
as described in the official docs is possible to enable ssh multiplexing for reusing ssh connections. When calling the command

docker-compose --context mysshcontext up -d

this log keeps repeting in the output:

mux_client_request_session: session request failed: Session open refused by peer
ControlSocket /home/users/myuser/.ssh/socket-myuser@myhost.com:22 already exists, disabling multiplexing

Does anyone know how to configure docker-compose or the ssh stuff to best utilize this feature?

NB: compose works if the ssh options are disabled.

Thanks!

marco

If anyone get these errors set ssh ControlPersist to no:
ControlMaster auto
ControlPersist no
ControlPath ~/.ssh/socket-%l-%r@%h:%p