Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing docker's load #288

Open
mynote opened this issue May 4, 2023 · 2 comments
Open

Missing docker's load #288

mynote opened this issue May 4, 2023 · 2 comments

Comments

@mynote
Copy link

mynote commented May 4, 2023

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

@mariotoffia
Copy link
Owner

@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

@mynote
Copy link
Author

mynote commented Jun 28, 2023

Thank you, Mario. Cheers, Emanuel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants