Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion eng/dockerfile-templates/Dockerfile.linux.install-deps
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@
[
"pkgs": pkgs,
"pkg-mgr": when(isDistrolessAzureLinux && !isAzureLinux3, "dnf", when(isDistrolessAzureLinux, "tdnf", "")),
"pkg-mgr-opts": pkgMgrOpts
"pkg-mgr-opts": pkgMgrOpts,
"upgrade-pkgs": when(OS_VERSION = "azurelinux4.0", [caCertsPkg], [])
])}}
10 changes: 8 additions & 2 deletions eng/dockerfile-templates/Dockerfile.linux.install-pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pkgs: list of packages to install
pkg-mgr (optional): package manager to use
pkg-mgr-opts (optional): additional options to pass to the package manager
upgrade-pkgs (optional): packages to upgrade in the DNF5 installation transaction
no-clean (optional): skip package manager cleanup after install ^

set isAlpine to find(OS_VERSION, "alpine") >= 0 ^
Expand All @@ -11,19 +12,24 @@
set isDnf to ARGS["pkg-mgr"] = "dnf" || (isAzureLinux && !isAzureLinux3 && ARGS["pkg-mgr"] != "tdnf") ^
set isTdnf to ARGS["pkg-mgr"] = "tdnf" || (!isDnf && isAzureLinux) ^
set isApk to ARGS["pkg-mgr"] = "apk" || isAlpine ^
set upgradePkgs to ARGS["upgrade-pkgs"] ^
set appendPkgSuffix(pkg, index) to:{{
_ Don't apply a space and continuation character after the package text if it's a comment or
the last of the Alpine packages ^
return find(pkg, "#") != 0 && !(isAlpine && index = len(ARGS["pkgs"]) - 1)
}}
}}{{
if isDnf:dnf install -y{{ARGS["pkg-mgr-opts"]}} \^
if isDnf && len(upgradePkgs) > 0:dnf --refresh do -y{{ARGS["pkg-mgr-opts"]}} \
--action=install \^
elif isDnf:dnf install -y{{ARGS["pkg-mgr-opts"]}} \^
elif isApk:apk add --upgrade --no-cache{{ARGS["pkg-mgr-opts"]}} \^
elif isTdnf:tdnf install -y{{ARGS["pkg-mgr-opts"]}} \^
else:apt-get update \
&& apt-get install -y --no-install-recommends{{ARGS["pkg-mgr-opts"]}} \}}{{
for index, pkg in ARGS["pkgs"]:
{{pkg}}{{if appendPkgSuffix(pkg, index):{{if pkg != "": }}\}}}}{{if !ARGS["no-clean"]:{{
{{pkg}}{{if appendPkgSuffix(pkg, index):{{if pkg != "": }}\}}}}{{if isDnf && len(upgradePkgs) > 0:
--action=upgrade \
{{join(upgradePkgs, " ")}} \}}{{if !ARGS["no-clean"]:{{
if isTdnf:
&& tdnf clean all{{ARGS["pkg-mgr-opts"]}}^
elif isDnf:
Expand Down
5 changes: 4 additions & 1 deletion src/runtime-deps/10.0/azurelinux4.0/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true

RUN dnf install -y \
RUN dnf --refresh do -y \
--action=install \
ca-certificates \
\
# .NET dependencies
Expand All @@ -18,6 +19,8 @@ RUN dnf install -y \
libstdc++ \
openssl-libs \
tzdata \
--action=upgrade \
ca-certificates \
&& dnf clean all

# Create a non-root user and group
Expand Down
5 changes: 4 additions & 1 deletion src/runtime-deps/10.0/azurelinux4.0/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true

RUN dnf install -y \
RUN dnf --refresh do -y \
--action=install \
ca-certificates \
\
# .NET dependencies
Expand All @@ -18,6 +19,8 @@ RUN dnf install -y \
libstdc++ \
openssl-libs \
tzdata \
--action=upgrade \
ca-certificates \
&& dnf clean all

# Create a non-root user and group
Expand Down
5 changes: 4 additions & 1 deletion src/runtime-deps/11.0/azurelinux4.0/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true

RUN dnf install -y \
RUN dnf --refresh do -y \
--action=install \
ca-certificates \
\
# .NET dependencies
Expand All @@ -18,6 +19,8 @@ RUN dnf install -y \
libstdc++ \
openssl-libs \
tzdata \
--action=upgrade \
ca-certificates \
&& dnf clean all

# Create a non-root user and group
Expand Down
5 changes: 4 additions & 1 deletion src/runtime-deps/11.0/azurelinux4.0/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true

RUN dnf install -y \
RUN dnf --refresh do -y \
--action=install \
ca-certificates \
\
# .NET dependencies
Expand All @@ -18,6 +19,8 @@ RUN dnf install -y \
libstdc++ \
openssl-libs \
tzdata \
--action=upgrade \
ca-certificates \
&& dnf clean all

# Create a non-root user and group
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading