miversen33 / netman.nvim

Neovim (Lua powered) Network Resource Manager
MIT License
337 stars 1 forks source link

Research the efficacy of having the docker provider utilize the docker socket instead of commands over shell out #65

Open miversen33 opened 2 years ago

miversen33 commented 2 years ago

Title

Right now, the docker provider talks to the docker binary to do stuff and consumes (and processes) the standard out to determine if the container is alive (in order to execute commands inside of it, browse its directory structure, etc). It might be worth seeing if we can instead just talk to the socket for more structured responses.

Or it might now be. Who knows.

miversen33 commented 1 year ago

Docker engine API spec

https://docs.docker.com/engine/api/v1.42/

miversen33 commented 10 months ago

Some other nice things this may handle is the ability to inspect the filesystem of containers that don't have shell access (such as distroless containers).

We can abuse the following command to "view" a container's filesystem without having to go through docker at all

sudo ls -lah /proc/$(docker inspect $CONTAINER_NAME_OR_ID --format '{{.State.Pid}}')/root/

The big issue here is that this will only work on linux. I have absolutely no idea how to accomplish this on windows. Even so, it is likely worth looking into