I am trying to create, run and link a set of docker containers using Rundeck. In short (for those who are not familiar with docker), when the image is running, it returns the container identifier. I would like to use this container identifier when starting subsequent jobs.
When launched from the command line, it will look something like this (example only !!):
34DEF123
321CB456
(note the use of the first return value in the second command line)
At this point, two containers will work. The second will be associated with the first parameter "-link", and it will be addressed using the hostname "host1" from within the second container. In fairness, it follows that the docker generates (or can indicate) a specific container name, which can be used instead of the container identifier. I would prefer to use the container identifier to avoid the need to create / track unique names.
I would like to be able to capture the output of the first command (container ID) so that it can be reused in the second command. Is it possible?
: " " ( , ), "docker rm" "docker rmi", . / .