code: function pullImageIfMissing(docker, image, options) {
    debug('ensure image', image);
    var pullStream = new PullStatusStream();
  
    // first attempt to find the image locally...
    docker.getImage(image).inspect().then(
      function inspection(gotImg) {
        // push a value directly to the result without the transform.
        pullStream.push(image + ' exists in the cache.\r\n');
        // end the stream.
        pullStream.end();
      },
  
      function missingImage() {
        debug('image is missing pull', image);
        // image is missing so pull it
        return docker.pull(image, options || {}).then(function(rawPullStream) {
          rawPullStream.pipe(pullStream);
        });
      }
    ).then(
      null,
      function handleErrors(err) {
        pullStream.emit('error', err);
      }
    );
  
    return pullStream;
  }
docs: Returns a stream suitable for stdout for the download progress (or the cache).
  
  @param {DockerodePromise} docker wrapper.
  @param {String} image docker image name.
  @param {Object} [options] docker pull options.
  @return {Promise[Stream]}