mirror of
https://github.com/moghtech/komodo.git
synced 2026-05-06 00:18:38 -05:00
[GH-ISSUE #75] [Feature] Add support to attach to running container terminal #1933
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @patcfly on GitHub (Sep 12, 2024).
Original GitHub issue: https://github.com/moghtech/komodo/issues/75
I would like to be able to attach to a running container's terminal in the Komodo web ui.
@mbecker20 commented on GitHub (Sep 13, 2024):
I'm not entirely sure how to accomplish this task.
I do have some idea to kind of fake it, achieving something close to an attach using a terminal client interface, and sending every line user executes atomically to
docker exec.I think this docker exec feature is much simpler, and should be able to do everything needed. But it's not docker attach and won't be just like docker attach over ssh. Mainly, the responses won't be stream back, but rather will resolve fully and send back whole response at once. The different wouldn't be noticeable for short running tasks but for anything long running, would give no feedback.
Let me know if this docker exec feature would be useful to you, as a precursor to potential full docker attach with streaming responses
@phillibl commented on GitHub (Oct 25, 2024):
I think having a button in komodo that runs something like 'docker exec -it mycontainer sh' for whatever the container is would be hugely beneficial.
It's easy enough to run over ssh but having the feature in the komodo web ui would be great
@markhaines commented on GitHub (Nov 25, 2024):
Would also love to see this. Dockge offers this ability; you can connect directly to the container's shell in the UI and it lets you switch from bash to sh if bash isn't supported. It's super useful and one of the main things missing for me that stops me migrating from dockge solution.
@alphaleonis commented on GitHub (Jan 1, 2025):
Same thing here. It is a really useful feature, so would love to see this implemented. Since for example dockge and portainer have this feature, it should be possible to get some ideas on how one could go about implementing it from there perhaps?
@ar3thien commented on GitHub (Jan 7, 2025):
+1
@SinisterSpatula commented on GitHub (Jan 21, 2025):
+1
@henrysaantos commented on GitHub (Jan 30, 2025):
+1
@asad-ali-bhatti commented on GitHub (Feb 13, 2025):
+1
@flintstones-fred commented on GitHub (Feb 18, 2025):
+1
@McGinn commented on GitHub (Feb 18, 2025):
+1
@kingp0dd commented on GitHub (Feb 18, 2025):
Docker exec one liners will be useful as i think majority of the use cases is this, for debugging or for executing quick backend commands.
I'm not sure if that's what dockge also does. For portainer, i think it's a full attach?
@alphaleonis commented on GitHub (Feb 19, 2025):
I'm no expert in this, but found the following issue on github which at least seems to contain some hints on how to accomplish this? (eg. running an interactive shell in a container using the API)
@stonkage commented on GitHub (Mar 12, 2025):
+1
@nanosonde commented on GitHub (Mar 16, 2025):
Hi!
Maybe you could use ttyd:
https://github.com/tsl0922/ttyd
See the usage examples in the ttyd wiki.
You could run something like:
ttyd <ttyd_options> docker exec -it container bash
It will then start a new web terminal with this command.
@nanosonde commented on GitHub (Mar 16, 2025):
Also found this: https://lib.rs/crates/webterm
Also uses xterm.js, backend written in Rust...
@nanosonde commented on GitHub (Mar 16, 2025):
Proxmox host and container consoles also use xterm.js:
https://github.com/proxmox/pve-xtermjs
(Rust code)
@Skyfay commented on GitHub (Mar 27, 2025):
+1
@signo1337 commented on GitHub (Apr 9, 2025):
...just to upvote for this crucial feature: +1
@Dinth commented on GitHub (Apr 19, 2025):
+1
@RedVelocity commented on GitHub (Apr 20, 2025):
Just following up on this topic. Is there a roadmap for the exec feature?
@Skyfay commented on GitHub (Apr 20, 2025):
As I see it, the problem is that the developer does not know how to implement this task at the moment.
@Redwid commented on GitHub (Apr 24, 2025):
+1
@lnlyssg commented on GitHub (Apr 24, 2025):
Please stop commenting +1 - it clutters up the issue and stops any actual useful discussion from being easily seen. If you just want to upvote this then please add a thumbs-up reaction to the issue instead.
@lnlyssg commented on GitHub (Apr 26, 2025):
It's coming! https://github.com/moghtech/komodo/pull/446
@Skyfay commented on GitHub (Apr 26, 2025):
This will initially only be the implementation for shell access. Exec still has to be executed manually. But Exec will most certainly be built on top of that.
@mbecker20 commented on GitHub (Apr 27, 2025):
container exec should be simple on top of the shell access in #446 . I'm going to go ahead and implement it before releasing 1.17.4
@nic96 commented on GitHub (May 9, 2025):
Wouldn't
docker attachbe just as simple asdocker exec -itnow that you have a terminal feature? I tested that it works attaching with the terminal feature e.gdocker attach --detach-keys=ctrl-d service-name.The tty and std_open options need to be in the docker compose service to be able to attach and interact:
@mbecker20 commented on GitHub (Aug 26, 2025):
@nic96 yes I am aware and attach should be fairly straightforward, leaving this issue open to implement this feature.
@Almie commented on GitHub (Feb 11, 2026):
+1 to also having a docker attach feature, would be greatly beneficial for me.
@mbecker20 commented on GitHub (Feb 12, 2026):
@Almie it is available in the dev releases https://github.com/moghtech/komodo/releases