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

nerdctl for Windows. #600

Merged
merged 3 commits into from
Sep 17, 2021
Merged

nerdctl for Windows. #600

merged 3 commits into from
Sep 17, 2021

Conversation

mook-as
Copy link
Contributor

@mook-as mook-as commented Sep 11, 2021

This implements a stub nerdctl bianry on Windows that execs into the (correct) WSL distribution.

This is in support of #566.

TODO:

  • Figure out how do deal with volume mounts (nerdctl run -v foo:bar)
  • Figure out how to do nerdctl build from Linux.

We will add more golang helpers soon.

Signed-off-by: Mark Yen <[email protected]>
This just forwards everything to wsl.exe to run nerdctl; things like volume
mounts will not work.  On a WSL Linux distro, this means going to the host
(to launch wsl.exe) and back again (to the rancher-desktop container).

Signed-off-by: Mark Yen <[email protected]>
@mook-as
Copy link
Contributor Author

mook-as commented Sep 13, 2021

I believe both building (from linux) and doing volumes will require doing arg parsing in the nerdctl stub (to figure out where the paths are for arguments), and are best done in a follow-up. So I'm going to mark this as ready for review for now, assuming we'll do follow-ups.

For now, Windows should be able to do nerdctl build . (but only using relative paths).

@mook-as mook-as marked this pull request as ready for review September 13, 2021 21:35
@mook-as
Copy link
Contributor Author

mook-as commented Sep 14, 2021

Note that I dropped f2093ca because it turned out that broke nerdctl run; we need to be in the correct WSL distro (mount namespace) to do that because nerdctl touches files directly, and not over the socket.

This includes nerdctl.

Signed-off-by: Mark Yen <[email protected]>
@ericpromislow
Copy link
Contributor

mook-as-win-nerdctl $ golint ./...
cmd/k3s.go:1:1: package comment should be of the form "Package cmd ..."
cmd/k3s_kubeconfig.go:1:1: package comment should be of the form "Package cmd ..."
cmd/kubeconfig.go:1:1: package comment should be of the form "Package cmd ..."
cmd/root.go:1:1: package comment should be of the form "Package cmd ..."

Assuming we want our go code to be clean

@mook-as
Copy link
Contributor Author

mook-as commented Sep 17, 2021

Hmm, golint appears to be deprecated; it seems to recommend staticcheck as a replacement, and that's fine with that code.

Also, note that you're linting code that is just moved, and no changes were made to it…

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

Successfully merging this pull request may close these issues.

2 participants