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

Add non-root user support #4397

Merged
merged 39 commits into from
Feb 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
737fd53
Add 8.0 images with new non-root user
lbussell Jan 24, 2023
e71bc0b
Regenerate Dockerfiles
lbussell Jan 24, 2023
02e6241
All new dockerfiles build now
lbussell Jan 24, 2023
26c26ca
Add jammy-chiseled 8.0 runtime-deps files for new aspnet ports
lbussell Jan 27, 2023
fc176d8
Move aspnet sample back to net7.0
lbussell Jan 27, 2023
aee134e
Update environment variables for 8.0 dockerfiles
lbussell Jan 30, 2023
7773de5
WIP tests
lbussell Jan 30, 2023
670ec48
Try to clear tmp directory when running dotnet help
lbussell Feb 1, 2023
74311e6
Clean up Dockerfiles
lbussell Feb 7, 2023
452945b
Merge remote-tracking branch 'upstream/nightly' into feature/non-root…
lbussell Feb 7, 2023
a60cc4f
Remove commented out tests that don't run
lbussell Feb 7, 2023
dc8141a
Remove https port variables
lbussell Feb 7, 2023
3fced5d
.NET versions < 8.0 want the --urls argument
lbussell Feb 7, 2023
9130588
Address some review comments
lbussell Feb 7, 2023
0d68933
Clean up ports, run fx dependent test as non-root
lbussell Feb 7, 2023
cfff6d4
Fix debian home creation behavior
lbussell Feb 7, 2023
0ae0262
Fix aspnet sample base images
lbussell Feb 7, 2023
991f949
Add equals sign back in group add command
lbussell Feb 7, 2023
c0b37b0
I don't know why I swapped these arguments, swap them back
lbussell Feb 7, 2023
ebb8aed
Correctly pass through create-home variable to non-root-user template
lbussell Feb 7, 2023
b2e63de
Update image size baselines
lbussell Feb 8, 2023
bc2dcd8
Update templates to accommodate shadow-utils in Mariner
lbussell Feb 9, 2023
31aea92
Regenerate dockerfiles.
lbussell Feb 9, 2023
8984b4f
Remove redundant dependency list
lbussell Feb 9, 2023
afe6f03
Regenerate dockerfiles
lbussell Feb 9, 2023
20ea44f
Fix samples
lbussell Feb 9, 2023
98b3ba7
Fix Mariner home directory and fix formatting
lbussell Feb 9, 2023
26cad58
Remove --create-home from jammy and alpine
lbussell Feb 9, 2023
6d493d9
put additional packages in alphabetical order and clean up some logic
lbussell Feb 9, 2023
1a0fa36
Change aspnet port env var in 8.0+ monitor dockerfiles
lbussell Feb 10, 2023
8d775f5
Make version checks in tests more serviceable
lbussell Feb 10, 2023
c5aae01
Clean up version checks in tests
lbussell Feb 13, 2023
40d8c42
Look for new environment variable to be unset in monitor tests
lbussell Feb 13, 2023
a880a6a
Add args back
lbussell Feb 13, 2023
cc858da
Fix no-clean logic to only clean once in mariner 8.0
lbussell Feb 13, 2023
452e753
7.0 doesn't have non-root support
lbussell Feb 13, 2023
c0442d4
Install shadow-utils in line with non-root user in mariner
lbussell Feb 13, 2023
daaa7e3
Revert to old install-deps template
lbussell Feb 14, 2023
724e253
Fix indentation in install-deps template
lbussell Feb 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions eng/dockerfile-templates/Dockerfile.linux.install-deps
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{
_ ARGS:
distroless-staging-dir (optional): Location of the staging directory for distroless installation
additionalPkgs (optional): Additional packages to install ^
isSdk (optional): Indicates whether the dependencies are installed for an sdk Dockerfile
distroless-staging-dir (optional): Location of the staging directory for distroless installation ^

set dotnetVersion to join(slice(split(PRODUCT_VERSION, "."), 0, 2), ".") ^
set isAlpine to find(OS_ARCH_HYPHENATED, "Alpine") >= 0 ^
Expand Down Expand Up @@ -45,15 +45,24 @@
"libstdc++6",
"zlib1g"
])) ^
set certsPkg to when(isDistrolessMariner, "prebuilt-ca-certificates", "ca-certificates") ^
set additionalPkgs to when(defined(ARGS["additionalPkgs"]), sort(cat(ARGS["additionalPkgs"], [certsPkg])), [certsPkg]) ^
set pkgs to cat(additionalPkgs, ["", dotnetDepsComment], pkgs)
set certsPkgPrefix to when(isMariner,
[
when(isDistrolessMariner, "prebuilt-ca-certificates", "ca-certificates"),
"",
dotnetDepsComment
],
[
"ca-certificates",
"",
dotnetDepsComment
]) ^
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to be indented more than everything else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted to the original version of this file that exists on nightly - but since it does look weird, I can address it here.

set pkgs to when(ARGS["isSdk"], pkgs, cat(certsPkgPrefix, pkgs))
}}{{InsertTemplate("Dockerfile.linux.install-pkgs",
[
"pkgs": pkgs,
"noninteractive": (OS_VERSION = "focal"),
"pkg-mgr": when(isDistrolessMariner, when (find(OS_VERSION, "1.0") >= 0, "dnf", "tdnf"), ""),
"pkg-mgr-opts": when(isDistrolessMariner,
cat(" --releasever=", OS_VERSION_NUMBER, " --installroot ", ARGS["distroless-staging-dir"]),
"")
""),
])}}