bake: handle tilde expansion in filepaths#3409
Conversation
2ffd2a7 to
cb73b63
Compare
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
cb73b63 to
d5c08e6
Compare
|
cc @crazy-max ptal 🙂 |
crazy-max
left a comment
There was a problem hiding this comment.
LGTM thanks!
Was wondering if fs entitlements would still be applied and looks like it as expansion happens when reading targets:
target "default" {
output = ["~/bake"]
}docker buildx bake --print
{
"group": {
"default": {
"targets": [
"default"
]
}
},
"target": {
"default": {
"context": ".",
"dockerfile": "Dockerfile",
"output": [
{
"dest": "/home/crazy/bake",
"type": "local"
}
]
}
}
}
docker buildx bake
#0 building with "default" instance using docker driver
#1 [internal] load local bake definitions
#1 reading docker-bake.hcl 43B / 43B done
#1 DONE 0.0s
Your build is requesting privileges for following possibly insecure capabilities:
- Write access to path /home/crazy
In order to not see this message in the future pass "--allow=fs.write=/home/crazy" to grant requested privileges.
Your full command with requested privileges:
docker buildx bake --allow=fs.write=/home/crazy
To disable filesystem entitlements checks, you can set BUILDX_BAKE_ENTITLEMENTS_FS=0 .
Do you want to grant requested privileges and continue? [y/N]
|
Slightly concerned if this will start users expecting |
|
@thaJeztah that's a valid concern. For things like I quite like the |
|
I agree with @thaJeztah that adding support for a Recently, @crazy-max added a Then |
jsternberg
left a comment
There was a problem hiding this comment.
Putting a request changes until we have a further discussion on if we want to merge this feature or not.
Description
Adds tilde expansion for filepath attributes in bake files.
~/path- expands to current user's home directory + path~- expands to current user's home directory~username/path- expands to specified user's home directory + pathNote on Windows support:
~is equivalent to%USERPROFILE%~usernameis not supportedRelated issues