-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Is it possible to add attach function to fig? #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Need it too! |
|
Maybe it's more convenient to use alias below in your terminal. |
It shouldn't be too difficult to add this using |
@bcheng049 the |
This would be huge for my team also |
@thaJeztah Yes, it is just a snippet to avoid inputing many commands without installing a script. |
Just wanted to clear that up to prevent people trying to solve problems that are already solved in the In the short run, I'd really advice people that want to have it now to install jpetazzo's script. Installing it is just a one-liner as explained in the readme; https://github.com/jpetazzo/nsenter After installing, entering a running container is just simply |
There's two issues here: 1) being able to enter with |
I think |
The set up I have in mind is |
|
It's an essential feature to configure docker container. When this feature are release ? |
I agree that |
It would be nice if attach was exposed in fig.yml, so that we could specify which one we want to attach to interactive tty on "fig up" |
@aanand Any update on when this may be available? |
this would be lovely! |
I'm strongly against the idea of doing an interactive attach on The correct way to bring up an interactive container with its dependencies is |
Aanand, you said:
I believe just those two will make a lot of people happy. I don't use Will this issue address both |
oops, wrong key, sorry |
@aanand even if it doesn't make sense in the context of |
@michaelsbradleyjr that might make some sense, in that there have been reports of software that complains if it can't find a tty. Still, I'm worried that such an option might confuse people into thinking that |
@aanand, @michaelsbradleyjr, I second that. When I do
I'd like to be able to get the repl even in production environment. |
@koddo I've been doing something similar. By the way, there's a tty-related bug in The documentation and help output don't mention it, and it can be tricky to figure out what's going on if you don't' think to check the output of the |
Just to help anyone looking here out I just found a simple solution that works for me.
app:
tty: true
stdin_open: true This also makes it possible to after the containers are up do I have no idea when this started getting possible but it works for me using docker 1.8.2 and docker-compose 1.3.3. Very thankful for this, it has been my major turnoff for developing using compose and python with pdb. Just wanted to make this clear because I did not get that it was this easy at all by reading this issue conversation. Mirroring the |
@thomasf to the rescue! |
does not work for me. It may be because I'm on Windows, or it may be a bug in a newer version of Compose. I'm on 1.6.0. |
Thanks @thomasf, you made my day |
Curious, what is different between |
'up' does not hook up the terminal stdin. It's not designed for interactive On Tue, 17 May 2016 at 00:02 Gabe Kopley [email protected] wrote:
|
Because I also wanted to #!/usr/bin/env bash
docker attach $(docker-compose ps -q $1) Name it But I believe it's better for docker-compose to have |
Our team has observed that while the config suggested by @thomasf does work nicely to permit interactive debugging of running containers, @k2nr first of all, thank you for the alias - it is certainly handy for myself and my team, as attach is a viable workaround in the face of the issue with the logs ^^ . I don't think however it belongs as a proper subcommand to docker-compose because it assumes that you only have one docker instance of the service running, which is not realistic in many cases. |
@dnephin I think what we're observing in first paragraph above ^^ might be an incident of #3106 (comment) - it's apparently Should I create a separate issue for this? /cc @thaJeztah |
ctr: add commands: `list` and `inspect`
With #3106 fixed and |
@thomasf That worked for me to get into a debugger, but it doesn't let me type anything - like typing in c, or n to continue through doesn't work (I have to ctrl + C and close the server to get out of it) |
For example, Using command "fig attach appname" to enter the container which was created by fig.
I think this may be helpful in some cases. Now I know that nsenter can attach a new bash shell on
a running container, but I don't know if it's possible to intergrate it with fig. Thanks.
The text was updated successfully, but these errors were encountered: