def build_from_string(string, dir = '.')
      dir = @options[:string_build_path] if @options[:string_build_path]
      Dir.mktmpdir do |tmpdir|
        FileUtils.cp_r("#{dir}/.", tmpdir)
        dockerfile = File.join(tmpdir, 'Dockerfile')
        File.open(dockerfile, 'w') { |f| f.write(string) }
        build_from_dir(tmpdir)
      end
    end
def build_from_string(string, dir = '.')
      dir = @options[:string_build_path] if @options[:string_build_path]
      Dir.mktmpdir do |tmpdir|
        FileUtils.cp_r("#{dir}/.", tmpdir)
        dockerfile = File.join(tmpdir, 'Dockerfile')
        File.open(dockerfile, 'w') { |f| f.write(string) }
        build_from_dir(tmpdir)
      end
    end
Builds the image from a string. Generates the Docker tag if required.

 It also saves the generated image in the object internally.

 This creates a temporary directory where it copies all the files and
 generates the temporary Dockerfile.

 @param string [String] The Dockerfile content.
 @param dir [String] The directory to copy the files from. Files that are
   required by the Dockerfile passed in *string*. If not passed, then
   the 'string_build_path' option is used. If that is not used, '.' is
   assumed.

 @return void

 @api private