title: How do I capture output from one Rundeck step to be used in a later step?
body: <p>I'm attempting to build, launch, and link a set of docker containers using Rundeck.  In short (for those not familiar with docker), when an image is launched, it returns a container ID.  I would like to use this container ID in the launching of subsequent jobs.</p>
  
  <p>When run from the command line, it would look something like this (example only!!):</p>
  
  <pre><code># docker run -Pd 23ABCD45
  34DEF123
  # docker run -Pd --link 34DEF123:host1 ABC123EF
  321CB456
  </code></pre>
  
  <p>(note the use of the first return value in the second command line)</p>
  
  <p>At this point, there would be two containers running. The second would be linked to the first by the <code>--link</code> option, and it would be addressable using the hostname <em>host1</em> from inside the second container. To be fair, docker generates (or may be given) a specific container name which can be used in place of the container id. I would prefer to use the container ID to avoid the hassle of having to create/track unique names.</p>
  
  <p>I would like to be able to capture the output of the first command (the container ID) so that it can be reused in the second command. Is this possible?</p>
  
  <blockquote>
    <p>Edit:  These images are being used for testing immediately following a
    "docker build" (which also outputs a similar ID I would like to
    include in my chain) and might be followed by "docker rm" and "docker
    rmi" commands, so there are a number of uses for capturing this type
    of output and carrying it through a related set of operations.  This
    is not just about launching/linking containers.</p>
  </blockquote>