docker-archive / dockercloud-cli

CLI for Docker Cloud
https://cloud.docker.com/
Apache License 2.0
74 stars 40 forks source link

Feature idea: container exec interactive #19

Closed stilliard closed 6 years ago

stilliard commented 8 years ago

Like docker exec -it /bin/bash but for docker-cloud.

sunshineo commented 7 years ago

+1 I want to be able to run jobs like this. I want to be able to create and deploy a service (with only one container), start the service and tail the logs from the service, and when the service finished the job and stop, delete the service, then the tool exit. Even if without create and deploy part, if I can start an existing service and tail the log and exit when the service stop, it would be great!

My current situation illustrated with this screenshot: cli

fermayo commented 7 years ago

Container exec is already available: docker-cloud container exec

sunshineo commented 7 years ago

Thank you @fermayo I'll check it out? How are you recently? I met you at Dockercon in Seattle.

sunshineo commented 7 years ago

Hi @fermayo , I checked it and see this

exec                Run a command in a running container

So this is not what we are looking for. The container that I wrote itself is the job. It starts, do the job and output the log at the same time, and exit 0 if job success or 1 if failed. This is really aligned with the Docker mentality. To use exec, I would have to change it to a long running container and connect to it to execute the job.

What I think would be a better (and hopefully easy) solution is to modify the container start command to have a "--it" option just like docker run.

usage: docker-cloud container start [-h] [--sync] identifier [identifier ...]

Start a container

positional arguments:
  identifier  container's UUID (either long or short) or name[.stack_name]

optional arguments:
  -h, --help  show this help message and exit
  --sync      block the command until the async operation has finished

Note: the '--sync' option is not what we want. It does not wait for the container to finish running and it does not have any log from the container.

fermayo commented 7 years ago

@sunshineo what you want is a service with autodestroy activated: https://docs.docker.com/docker-cloud/apps/auto-destroy/

What the OP wants is the existing docker-cloud container exec command. @stilliard can you please confirm?

stilliard commented 7 years ago

Hi @fermayo , Actually I want interactive mode. I'm aware of the docker-cloud container exec command, but i'd like to able to enter an interactive bash session etc. in the same way as the main docker exec command has a "-i" param for interactive.

sunshineo commented 7 years ago

@fermayo I can launch a service with auto destroy using the cli, but I need the cli to block and stream the logs from the service/container.

sunshineo commented 7 years ago

Any updated thoughts on this?

leifg commented 6 years ago

Yep, that feature would be great

stilliard commented 6 years ago

Closing as the repo has been deprecated.