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

Execute Docker credential programm through shell on Windows #4763

Merged
merged 1 commit into from Dec 3, 2021
Merged

Execute Docker credential programm through shell on Windows #4763

merged 1 commit into from Dec 3, 2021

Conversation

mruemeli
Copy link
Contributor

@mruemeli mruemeli commented Dec 2, 2021

We are trying to run testcontainers on Windows with an internal repository hosted by Google. This requires to run the"docker-credential-gcloud" (from Google Cloud SDK) to obtain credentials by using zt-exec. Eventhough the bin folder of the SDK is listed in the Path environment variables the ProcessExecutor is not able to run it and fails with the error message "Cannot run program "docker-credential-gcloud": CreateProcess error=2, Das System kann die angegebene Datei nicht finden"
(meaning "The system could not find the specified file.").

The reason is that the PATH envionment variable is not honored when starting a process on Windows. See zt-exec bug report zeroturnaround/zt-exec#98 (comment)

The following patch forces the command to be executed on cmd shell on Windows to ensure PATH is used.

@kiview
Copy link
Member

kiview commented Dec 2, 2021

Thanks a lot for raising this PR @mruemeli, the explanation makes a lot of sense.

LGTM.

Can you have another look @rnorth?

@rnorth
Copy link
Member

rnorth commented Dec 3, 2021

This looks sensible to me too - thanks @mruemeli!

@rnorth rnorth merged commit 4aef1dc into testcontainers:master Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants