-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RFC: Removed the default set PATH for Windows environments. #4895
Draft
danielGithinji
wants to merge
2
commits into
moby:master
Choose a base branch
from
danielGithinji:fix-overriding-default-windows-path
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
RFC: Removed the default set PATH for Windows environments. #4895
danielGithinji
wants to merge
2
commits into
moby:master
from
danielGithinji:fix-overriding-default-windows-path
+65
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
danielGithinji
changed the title
Removed the default set PATH for Windows environments to allow Window…
Removed the default set PATH for Windows environments.
May 2, 2024
danielGithinji
changed the title
Removed the default set PATH for Windows environments.
RFC: Removed the default set PATH for Windows environments.
May 2, 2024
danielGithinji
force-pushed
the
fix-overriding-default-windows-path
branch
from
May 2, 2024 11:48
3e47de5
to
7b1de15
Compare
github-actions
bot
added
area/dockerfile
area/llb
area/testing
area/hack
building buildkit itself
area/dependencies
Pull requests that update a dependency file
area/ci
area/client
area/frontend
area/util
area/api
area/buildkitd
area/remotecache
area/docs
area/examples
area/executor
area/exporter
area/session
area/solver
area/source
area/sourcepolicy
area/worker
area/buildctl
labels
Aug 14, 2024
danielGithinji
force-pushed
the
fix-overriding-default-windows-path
branch
from
August 14, 2024 21:35
2e4fe59
to
e2a0a84
Compare
github-actions
bot
removed
area/dependencies
Pull requests that update a dependency file
area/ci
area/client
area/api
area/buildkitd
area/remotecache
area/docs
area/examples
area/executor
area/exporter
area/session
area/solver
area/source
area/sourcepolicy
area/worker
area/buildctl
labels
Aug 14, 2024
danielGithinji
force-pushed
the
fix-overriding-default-windows-path
branch
from
September 27, 2024 16:49
6c0366d
to
113c423
Compare
danielGithinji
force-pushed
the
fix-overriding-default-windows-path
branch
from
September 27, 2024 16:52
113c423
to
af8c591
Compare
danielGithinji
force-pushed
the
fix-overriding-default-windows-path
branch
from
September 27, 2024 16:59
af8c591
to
1c4cb16
Compare
…ecks whether the path in a Windows container image can be set or not. Signed-off-by: Daniel Githinji <dgithinji@microsoft.com>
…s images to set the PATH while running Signed-off-by: Daniel Githinji <dgithinji@microsoft.com>
danielGithinji
force-pushed
the
fix-overriding-default-windows-path
branch
from
September 27, 2024 17:03
1c4cb16
to
ddb7a7c
Compare
Also see ; |
Hi @thaJeztah -- we've been trying to get some context from the previous PR but was getting lost in the discussions. If you don't mind, able to help with a summary? Esp.
Thanks for TAL. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is related to this PR: Don't set a default PATH for Windows #3158.
Description:
This change seeks to remove the defaulted Windows image path found in util\system\path.go.
When the PATH is defaulted to a specific value, application files for applications like PowerShell and any other installed application cannot be found/referenced. The reason for this is that Windows saves its environment variables in the registry.
Let's look at some examples to drive this point home.
Example 1: Get access to powershell
I used buildkit to create two images with following dockerfile contents:
When you run this image you get the following result:
Running the image gives the following result:
Example 2: Installing an application or binary
I created an image that has an installed Go binary using the following dockerfile:
Dockerfile:
Image build results:
Image build results:
From Example 2 above, its clear to see how installing binaries/applications where the PATH has a default value ensures that the application can't be accessed from the env path variable, unless its referenced from the specific location that its in installed in.
When the PATH isn't set the installed application path is set in both the registry item as well as path that is available when running the image.
Example 3:
The following examples make use of setx /m command that is specific to Windows to update the path.
Here's the dockerfile that I used:
Image build results:
In this case the setx command does not update the path env variable
Image build results:
Conclusion:
There are several versions of windows containers each with its own use-case. For example servercore(that used in the examples above) is used because it contains powershell whereas images with the .net libraries are used for that particular function. Each of these images have different installed native applications and libraries.
When the PATH is defaulted accessibility to image applications is lost and a lot of manual steps such as using the full path for each application has to be done in order to use them.
Therefore removing the defaulted Windows image path: