cli/command/container: add create/run --umask - #7108
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
cbf6120 to
029da50
Compare
|
@zhangyoufu the other PR was merged, so you can drop the first commit. Also may need to |
Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
|
Still trying to figure out the e2e test error |
|
Yeah the e2e tests run against the current stable. We need a skip for older API versions |
|
and this one, the umask is not effective Is it due to the engine version being |
|
Yes, that change wasn't in the RC yet. |
| } | ||
|
|
||
| func TestRunUmask(t *testing.T) { | ||
| environment.SkipIfDaemonNotLinux(t) |
There was a problem hiding this comment.
I think it's fine to add a t.Skip("FIXME: un-skip once e2e tests v29.8.0")
We can replace that with a version-based skip later (feature is already tested in the moby repository at API level)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
docker runto set umask in container moby/moby#19189moby/moby#19189 requested this feature in 2016. (labeled milestone 29.8.0 at the time of writing)
opencontainers/runtime-spec#941 added
Spec.Process.User.Umaskin 2019.containers/crun#217 added umask support in 2019.
opencontainers/runc#2527 added umask support in 2020.
opencontainers/runc#3661 added umask support for exec in 2023.
- What I did
I added HostConfig.Umask field in moby/moby#53463.
This PR implements the CLI part,
docker create/run --umask <octal>.Blocked by #7281 vendoring moby api changes.- How I did it
- How to verify it
docker run --rm --umask 1 alpine sh -c umask
- Human readable description for the release notes