lima icon indicating copy to clipboard operation
lima copied to clipboard

bash: line 1: nerdctl: command not found

Open christhomas opened this issue 3 years ago • 13 comments

Description

lima version: 0.9.0 machine: m1 max macbook

Description When I install lima from brew using the instructions on the README, I get so far that I can see the virtual machine running. But when I try to run lima nerdctl I get bash: line 1: nerdctl: command not found

So I'm trying to hunt down the missing instructions. But I've not found out what it is yet. Does anybody know?

I was told that this is by default and my issue was closed without any further discussion, so I have to open another issue with the same information because the issue is not fixed by the help given.

> nerdctl.lima
bash: line 1: nerdctl: command not found

and the contents of this file is just a shell script wrapper around lima nerdctl anyway

> cat $(which nerdctl.lima)
#!/bin/sh
set -eu
exec lima nerdctl "$@"

So to recap: lima nerdctl doesn't work and the nerdctl.lima script is just a wrapper around lime nerdctl anyway. So neither of this solutions works right now.

So I have the same problem, even with the help suggested. Please don't automatically close this issue without letting me respond.

christhomas avatar Mar 13 '22 19:03 christhomas

What does limactl shell default nerdctl show ? Did you add some shell alias, called "lima" ?

afbjorklund avatar Mar 13 '22 20:03 afbjorklund

It shows the same

limactl shell default nerdctl bash: line 1: nerdctl: command not found

christhomas avatar Mar 13 '22 20:03 christhomas

It is of course possible that the nerdctl installation failed to install the nerdctl command in the VM.

anders@ubuntu:~$ lima
anders@lima-default:/home/anders$ which nerdctl
/usr/local/bin/nerdctl

There should be traces of it in /var/log/cloud-init-output.log, inside the virtual machine.

sudo grep nerdctl /var/log/cloud-init-output.log

afbjorklund avatar Mar 13 '22 20:03 afbjorklund

I can run docker containers if I shell into the lima vm I created and use docker there.

> limactl shell default docker run -it --rm alpine sh
/ # uname -a
Linux b5827e18c7d4 5.13.0-28-generic #31-Ubuntu SMP Thu Jan 13 17:44:32 UTC 2022 aarch64 Linux

christhomas avatar Mar 13 '22 20:03 christhomas

Ah, if you use the docker.yaml you will get docker (and not nerdctl, as per default.yaml)

But then it will normally show you the instructions, on how to configure your docker client ?

afbjorklund avatar Mar 13 '22 20:03 afbjorklund

I created the vm like this lima start --name=default template://docker

I want to run containers as if it was docker, I thought I could do that with nerdctl?

Looking back at the installation instruction, it's not explained that using the docker template doesn't use nerdctl. But if I want to use it but running containers, then how can I do it using nerdctl? Perhaps this is just a documentation issue?

christhomas avatar Mar 13 '22 20:03 christhomas

I created the vm like this lima start --name=default template://docker

I want to run containers as if it was docker, I thought I could do that with nerdctl?

Looking back at the installation instruction, it's not explained that using the docker template doesn't use nerdctl. But if I want to use it but running containers, then how can I do it using nerdctl? Perhaps this is just a documentation issue?

christhomas avatar Mar 13 '22 20:03 christhomas

Alright well I did see those instructions and none of them worked, perhaps again a documentation issue. See this issue here: https://github.com/lima-vm/lima/issues/728

christhomas avatar Mar 13 '22 20:03 christhomas

Perhaps this is just a documentation issue?

It seems that way. The engines need to be separate.

default.yaml uses nerdctl.lima docker.yaml uses docker podman.yaml uses podman etc

They all allow running containers, but each in their own way.

afbjorklund avatar Mar 13 '22 20:03 afbjorklund

I think a couple of lines of text adding that default.yaml lets you use nerdctl like it explains in about 10+ tutorials around the web, but this is not available with docker.yaml, because that was not obvious and not documented from what I can see. So it's a bit confusing. Do you mind adding that as a piece of text on that readme section? I think it would help a lot.

I could also do a pull request, but then I'd have to fork the repo and make a pull request for a single text edit but you might know exactly how to write this better than I would. Do you prefer me to open a pull request?

christhomas avatar Mar 13 '22 21:03 christhomas

Personally I think the README is getting a bit long, but the change from docker.yaml to template://docker is quite recent

My idea (in https://github.com/afbjorklund/lima-gui/issues/7) was having it more like a "book", but text is text I suppose. Maybe a PR for maintainers ?

afbjorklund avatar Mar 13 '22 21:03 afbjorklund

Yeah I like that idea, I've seen projects use the wiki functionality for it and use the README.md to link into the front page and then break stuff up, especially a complex project like this.

Btw. I'm super impressed so far. I haven't pushed this to running more than a couple of simple containers. But I'm about to launch a whole microservice docker container setup on it ;) I wonder how it'll react

christhomas avatar Mar 13 '22 21:03 christhomas

Eventually it will need a website for users, and not just this GitHub developer page...

I like GitHub Pages myself, but I don't know what Lima says ? But there is a logo now!

afbjorklund avatar Mar 13 '22 21:03 afbjorklund