FluentDocker icon indicating copy to clipboard operation
FluentDocker copied to clipboard

Missing docker's load

Open mynote opened this issue 1 year ago • 2 comments

I'm not sure if i am wrong, but I couldn't find a wrapper for docker's load functionality for offline usage.

Example:
docker save --output myimage.tar myimage
docker load --input myimage.tar

mynote avatar May 04 '23 12:05 mynote

@mynote That is true! If you'd like, please submit a PR that implements those commands (Commands/client.cs) - around this fashion:

    public static CommandResponse<IList<string>> Load(this DockerUri host, string image, bool quiet = true, ICertificatePaths certificates = null)
    {
      var args = $"{host.RenderBaseArgs(certificates)}";
      var options = string.Empty;

     if (quiet) {
      options += "--quiet";
    }

      return
        new ProcessExecutor<StringListResponseParser, IList<string>>(
          "docker".ResolveBinary(),
          $"{args} load --input {image} {options}").Execute();
    }

...and a unit test to save and then load the image...

Cheers, Mario

mariotoffia avatar May 04 '23 15:05 mariotoffia

Thank you, Mario. Cheers, Emanuel

mynote avatar Jun 28 '23 07:06 mynote