Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Regarding the Terminal Option in the Compose-UI #4

Closed
mkscala opened this issue Aug 14, 2015 · 16 comments
Closed

Regarding the Terminal Option in the Compose-UI #4

mkscala opened this issue Aug 14, 2015 · 16 comments

Comments

@mkscala
Copy link

mkscala commented Aug 14, 2015

Hi,
Is is possible to add a terminal(tty) embedded in the UI which will help us to checks the logs and run commands within the browser.

Thanks,
Mani

@francescou
Copy link
Owner

Hello Mani,

it could be interesting to integrate a TTY in the application. I will investigate about the feasibility of this feature ASAP

@francescou
Copy link
Owner

there is no standard way to open a terminal using docker-py (see docker/docker-py#390, docker/docker-py#239, docker/docker-py#389).
Maybe it could be possible using https://github.com/d11wtq/dockerpty (it is already used by docker-compose: https://github.com/docker/compose/blob/master/requirements.txt#L4) but I didn't find a way to perform a docker exec -it $CONTAINER /bin/bash on a running container (there is also an issue about this: d11wtq/dockerpty#30)

@WTFKr0
Copy link
Contributor

WTFKr0 commented Jun 28, 2016

Hi !

Any news on that feature ?

@francescou
Copy link
Owner

I did some test with the latest docker pty
(see commit 258b7e0)

There is no GUI at the moment but you can try it from an HTTP client:

curl -X POST http://localhost:5000/api/v1/terminal -H'Content-type: application/json' --data '{"command":"ls -lrt /", "name":"node-redis", "id":"noderedis_redis_1"}'

@francescou
Copy link
Owner

added experimental UI in 4b040de

cc @dvdred

@francescou
Copy link
Owner

current solution, based on exec_create and exec_start is too limiting: there is no way to run interactive commands (e.g. redis-cli). I guess a better alternative would be to use websockets.

@allamand
Copy link

allamand commented Nov 8, 2016

Hi Guys,

You can perform this using shipyard project you can set-up on top of existing docker or swarm cluster.

I used this compose to launch shipyard with docker-ui on a swarm with a Traefik proxy for routing

version: '2'

services:
 rethinkdb:
    image: rethinkdb:latest
    labels:
      - "traefik.enable=false"
    networks:
      - back

 shipyard:
    image: shipyard/shipyard:latest
    container_name: shipyard-controller
    restart: always
    expose:
      - "8080"
    depends_on: ["rethinkdb"]
    volumes:
      - /etc/docker/swarm:/ssl:ro
    command: |
      --debug
      server 
      -d tcp://10.234.172.115:3376 
      --tls-ca-cert=/ssl/ca.pem 
      --tls-cert=/ssl/server.pem 
      --tls-key=/ssl/server-key.pem
    labels:
      - "traefik.frontend.rule=Host:shipyard.mydomain.com"
      - "traefik.docker.network=traefik_net"
    networks:
      - traefik_net
      - back

networks:
  traefik_net:
      external: true
  back:
    driver: overlay

@mkscala
Copy link
Author

mkscala commented Nov 17, 2016

@allamand , shipyard integration gives an CLI or Unix like web Terminal UI ?

@allamand
Copy link

@murugesh it's a unix like terminal ui (a console in the browser) I can show example if you like, I launch my shipyard using compose-ui

Sébastien

Le 17 nov. 2016 à 19:04, Murugesh [email protected] a écrit :

@allamand , shipyard integration gives an CLI or Unix like web Terminal UI ?


You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

@mkscala
Copy link
Author

mkscala commented Nov 17, 2016

I would live to see the example, how can you show me?

@mkscala
Copy link
Author

mkscala commented Nov 17, 2016

I would love to see the example, how can you show me?

@allamand
Copy link

I used this compose file : https://gist.github.com/allamand/e4f6a6229804007fa8f1a37761745031.

I din't saw the entire video but it should create something like this https://www.youtube.com/watch?v=aLlp-kemx_s

@MichaelMackus
Copy link
Contributor

MichaelMackus commented May 11, 2017

Looks like there's an API method in Docker Engine which exposes the raw stream from the docker exec. Here is the relevant code from Shipyard which seems to just connect to that endpoint & open it up with websockets.

@francescou would you accept PRs for similar functionality? Seems like its all implemented in Docker Engine, so the missing piece would be the Websocket connection (likely from some Python websocket library).

@francescou
Copy link
Owner

@MichaelMackus I would be really interested. I've also made some experiments with websockets in python/Flask (using gevent, see #14) but I didn't like how these framework worked together.

@MichaelMackus
Copy link
Contributor

Good to hear! I did try some experimenting with Websockets as well, but I'm still trying to wrap my head around the protocol (& integrating it with Flask). I'll let you know what I find.

@francescou
Copy link
Owner

This feature has been released in francescou/docker-compose-ui:1.8.0 thanks to #91

instructions:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants