Compose: Pass --detach-keys to docker-compose

Created on 12 Apr 2016  ยท  26Comments  ยท  Source: docker/compose

docker run has the option to pass an alternative sequence to detach. Currently it is mapped to ctrl-p ctrl-q, but I heavily use ctrl-p in the cli and Vim, so I would like to remap. Is that possible with Compose? If not, this is a feature request. :)

kinfeature

Most helpful comment

I'm experiencing the same issue. (using Docker for Mac)

I've remapped my ~/.docker/config.json like this:

{
  "detachKeys": "ctrl-q,ctrl-q"
}

and it's working fine for normal docker run but not for docker-compose.

Would be awesome if the config file was read when using docker-compose. ๐ŸŽ‰ Keep up the good work with this tool.

All 26 comments

while docker cli supports detach-keys. I do want the same feature applied in docker-compose too.

+1 - this would be a very useful feature

+1

+1

+1

:+1:

+1 Question though... it's possible to save detachKeys in ~/.docker/config.json. When Compose runs Docker, why doesn't it use these configs?

+1

My workaround

docker exec -it $(docker-compose ps -q mycontainer) bash

I'm experiencing the same issue. (using Docker for Mac)

I've remapped my ~/.docker/config.json like this:

{
  "detachKeys": "ctrl-q,ctrl-q"
}

and it's working fine for normal docker run but not for docker-compose.

Would be awesome if the config file was read when using docker-compose. ๐ŸŽ‰ Keep up the good work with this tool.

+1

Hi, is there a pr for this?

+1

+1

+1 again

+1

+1

Is there any movement?

+1

Is this something that would be useful? If so I would be interested in tackling it.

Yes! Exceptionally so

On Nov 30, 2017 1:45 PM, "Madeline" notifications@github.com wrote:

Is this something that would be useful? If so I would be interested in
tackling it.

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/docker/compose/issues/3311#issuecomment-348282236,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAvmBkikxNG_RbaBSrbHsuECRvqDSHdkks5s7ve9gaJpZM4IFTF6
.

@summergirl21 for example, it's not really comfy to use bash history via C-p because docker treats it as prefix and waits for next key. This is kinda frustrating:)
And think about vim/nano/whatever users, who use editor inside container. I guess now they are forced to use docker exec instead of docker-compose exec

I sent a PR to fix this problem.
https://github.com/docker/docker-py/pull/1826

I guess it takes a while to get merged and released so I built patched docker-compose:
https://bintray.com/mtsmfm/docker/compose#files

It respects our detachKeys setting as well as docker command does.

Please let me know if you find any bugs ๐Ÿ›

Nice Job ๐Ÿ‘ .

Awesome

On Dec 23, 2017 01:58, "hongliang" notifications@github.com wrote:

Nice Job ๐Ÿ‘ .

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/docker/compose/issues/3311#issuecomment-353711008,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAvmBq6qMiQb7-bmSE36gH7LBPsQOjblks5tDKSHgaJpZM4IFTF6
.

AFAICS docker/docker-py#1826 was merged 2018-01-31 for milestone 3.0.0. Can this issue be closed @Gijsjan, @mtsmfm? In which version of docker-compose will this feature become available?

In which version of docker-compose will this feature become available?

It's available from docker-compose 1.20.0

https://github.com/docker/compose/commit/d8d484e0e19db5326afeb4cdf56864eceb81566c#diff-b4ef698db8ca845e5845c4618278f29a

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidbarratt picture davidbarratt  ยท  3Comments

HackerWilson picture HackerWilson  ยท  3Comments

Hendrik-H picture Hendrik-H  ยท  3Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  ยท  3Comments

squeaky-pl picture squeaky-pl  ยท  3Comments