Closed stilliard closed 6 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:
Container exec is already available: docker-cloud container exec
Thank you @fermayo I'll check it out? How are you recently? I met you at Dockercon in Seattle.
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.
@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?
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.
@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.
Any updated thoughts on this?
Yep, that feature would be great
Closing as the repo has been deprecated.
Like docker exec -it /bin/bash but for docker-cloud.