docker / docs

Source repo for Docker's Documentation
https://docs.docker.com
Apache License 2.0
4.18k stars 7.32k forks source link

At minimum document CWD of the executed host process for each platform and better yet align it with extension folder root. #21443

Open sandipchitale opened 2 days ago

sandipchitale commented 2 days ago

Is this a docs issue?

Type of issue

Information is incorrect

Description

I was trying to use a relative path to file that is supposed to get copied into the extension folder. Then I was trying to use a relative path e.g.

const output = await ddClient.extension.host?.cli.exec("kubectl", [ "apply", "-f", "./folder/manifest.yml", ])

This worked on Linux. But on windows I was getting path for found errors for the relative path ./folder/manifest.yml . It turned out that the working directory on windows is not consistent. The location where the files of extension are and what is the CWD of the launched kubectl process are not the same.

The CWD is:

C:\Users\%USER%\AppData\Local\Docker

but the files are in

C:\Users\%USER%\AppData\Roaming\Docker\extensions\my-extension\...

So I had to adjust the relative path.

In general please document what the CWD is and even what ENV is setup when running hols executables for each platform. Or even better, make sure to align the CWD with the root of the extension files folder on all platforms.

Location

https://docs.docker.com/reference/api/extensions-sdk/ExtensionCli/

Suggestion

No response