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
builder: Isolate Git from local system #44324
Conversation
BuildKit had a timeout (not sure if just flaky); let me post the output just in case
trace:
|
Hmm... Windows failures look related (may be something in the test, or because
|
Some failures in the archive tests there as well ( This path looks funky though (double
|
ee0a34b
to
c134859
Compare
This comment was marked as resolved.
This comment was marked as resolved.
c134859
to
66d0dca
Compare
Make the test more debuggable by logging all git command output and running each table-driven test case as a subtest. Signed-off-by: Cory Snider <csnider@mirantis.com>
Keep It Simple! Set the working directory for git commands by...setting the git process's working directory. Git commands can be run in the parent process's working directory by passing the empty string. Signed-off-by: Cory Snider <csnider@mirantis.com>
Prevent git commands we run from reading the user or system configuration, or cloning submodules from the local filesystem. Signed-off-by: Cory Snider <csnider@mirantis.com>
While it is undesirable for the system or user git config to be used when the daemon clones a Git repo, it could break workflows if it was unconditionally applied to docker/cli as well. Signed-off-by: Cory Snider <csnider@mirantis.com>
Setting cmd.Env overrides the default of passing through the parent process' environment, which works out fine most of the time, except when it doesn't. For whatever reason, leaving out all the environment causes git-for-windows sh.exe subprocesses to enter an infinite loop of access violations during Cygwin initialization in certain environments (specifically, our very own dev container image). Signed-off-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Cory Snider <csnider@mirantis.com>
9c02e8d
to
67d010b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The BuildKit failure is in the unit-test that were removed in #44337, so should be ignored. |
bringing this one in 👍 |
- What I did
Changed how git is invoked by builder to stop it from reading configuration from the host system and to block it from cloning submodules off the local filesystem. It is no longer possible for a specially-crafted remote repository to clone a repository on the local filesystem into the build context.
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)