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

fix(docs): update installation steps for windows and linux #2112

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

profnandaa
Copy link

This PR updates the installation instructions for Windows and Linux.

We didn't have Windows installation steps and the Linux one was using brew (needs another extra installation);
sort of an anti-pattern from how we install the rest of the ecosystem tools like containerd, etc.

@profnandaa profnandaa marked this pull request as draft March 20, 2023 04:39
@profnandaa
Copy link
Author

ctr run works okay but getting this when I run nerdctl run, let me fix that and update the README too:

nerdctl run --rm -it mcr.microsoft.com/windows/nanoserver:ltsc2022 cmd
time="2023-03-20T04:32:35Z" level=fatal msg="failed to create default network: needs CNI plugin \"nat\" to be installed in CNI_PATH (\"C:\\\\Program Files\\\\containerd\\\\cni\\\\bin\"), see https://github.com/containernetworking/plugins/releases: exec: \"C:\\\\Program Files\\\\containerd\\\\cni\\\\bin\\\\nat\": file does not exist"

@@ -134,16 +134,20 @@ In addition to containerd, the following components should be installed:

These dependencies are included in `nerdctl-full-<VERSION>-<OS>-<ARCH>.tar.gz`, but not included in `nerdctl-<VERSION>-<OS>-<ARCH>.tar.gz`.

### Brew
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just renamed to Linux the other items are based on the OS types instead, i.e. Windows, FreeBSD, MacOS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like we lost the On Linux systems you can install nerdctl via [brew](https://brew.sh): below?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsturtevant -- I've replaced that with the standard installation process on Linux. I don't see a reason to install brew first so that you can install nerdctl when most likely they have already installed containerd, etc. using the standard process of getting the binaries from Github with curl.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep brew install instructions and we can add the additional manual process. Then the user can choose what is best for them.

README.md Outdated Show resolved Hide resolved
@profnandaa
Copy link
Author

profnandaa commented Mar 20, 2023

@AkihiroSuda -- thanks for the review, going to make the changes.
I finally have nerdctl running but the way I've set up the CNI-plugin is hacky hence I get this warning:

level=warning msg="default network named \"nat\" does not have an internal nerdctl ID or nerdctl-managed config file, it was most likely NOT created by nerdctl"

What is the best way of setting up the CNI plugin for windows?

I was trying to adapt this bash script here (which I think should be done in PowerShell instead, working on that) - https://gist.github.com/profnandaa/e9ab7bd7e069ce2728840b041ce4c300

@profnandaa profnandaa changed the title fix(docs): update installation steps for win and linux fix(docs): update installation steps for windows and linux Mar 22, 2023
@aznashwan
Copy link
Contributor

@profnandaa don't worry about that warning message, even if you didn't explicitly ask for network settings for your container, it's due to the fact that nat is the network name nerdctl defaults to on Windows.

This special treatment of the default network is the result of #1538, after which nerdctl can tell whether a network was initially created by itself as the default network by setting a special label on it.

I was trying to adapt this bash script here

That's perfect since it's basically the "reference configuration" which is used in both the containerd CI, as well as being basically 1:1 lifted to be used in the nerdctl CI too.

Although there's basically no reason to worry about that warning message, and I wouldn't necessarily bother mentioning it in the docs, but you could dodge it by opening the network config file shown in nerdctl network list and either:

  • renaming that network to something other than nat (NOTE: the type should still stay nat!)
  • keep the nat name but add the following line to the top-level of the config:
{
  ...
   // NOTE: this ID field is all you'll really need, and you can invent your own ID if needed.
  "nerdctlID": "d919a100ce6b45524d415d52d088d5817587c6dd8c3691b03b8063c44d043523",
  "nerdctlLabels": {
    "nerdctl/default-network": "true"
  },
  ...
}

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.

None yet

4 participants