lazydocker icon indicating copy to clipboard operation
lazydocker copied to clipboard

error editing config

Open pixx1 opened this issue 6 years ago • 8 comments

Hi there! First, thanks for the nice tool!

I run into the issue when I tried to change the configure. By pressing "o" i get the error

"exec: "sh": executable file not found in $PATH

Did i missed something? I'm using lazydocker in a docker.

System: lazyteam/lazydocker:latest ubuntu 18.04 docker: Docker version 19.03.2, build 6a30dfc

Thanks! pix_1

EDIT: This not happen when using the binary version.

pixx1 avatar Sep 05 '19 14:09 pixx1

@qdm12 any ideas on that?

dawidd6 avatar Sep 05 '19 17:09 dawidd6

It's because the binary is on a Scratch image so there is no shell. What program does lazydocker use to modify the configure? Maybe we can incorporate it in Go? Otherwise we can have the go binary on Alpine which should solve the problem but it's less fancy.

qdm12 avatar Sep 05 '19 20:09 qdm12

https://github.com/jesseduffield/lazydocker/blob/a3b3c94ed2c09e898bf2885a59ada921a318d585/pkg/commands/os.go#L127-L168

c.Config.UserConfig.OS.OpenCommand defaults to xdg-open on linux.

dawidd6 avatar Sep 05 '19 21:09 dawidd6

Maybe put a statically built xdg-open binary next to lazydocker in the scratch image? I'm away from keyboard but I'll check later.

EDIT: I'm looking into it now, I might have an ugly solution to copy paste xdg-open from an Alpine image to /bin.

qdm12 avatar Sep 05 '19 21:09 qdm12

When you try to edit the configuration with e, it also fails with this error. I will try to add a static build of vi to see if it works out.

Concerning o to open the config file, I end up here but I'm not sure where to look now, some help would be appreciated 😄

Should we simply let the user modify the config by bind mounting it on the Docker host?

qdm12 avatar Sep 11 '19 23:09 qdm12

@qdm12 I think bind mounting is a good solution.

As for your question about the OpenFile config option, happy to give guidance but I'm not sure what you're looking for haha

jesseduffield avatar Sep 14 '19 08:09 jesseduffield

Open in nano or vim?

meteoro avatar Nov 01 '23 14:11 meteoro

@meteoro could you please clarify what is the question?

mark2185 avatar Nov 01 '23 14:11 mark2185