Skip to content
Open
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
31 changes: 31 additions & 0 deletions universal/ubi10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,28 @@ EOF

ENV PATH="/usr/local/google-cloud-sdk/bin:${PATH}"

## Azure CLI
RUN <<EOF
set -euf -o pipefail

case "$TARGETARCH" in
amd64|arm64)
# Azure CLI installation for amd64 and arm64
rpm --import https://packages.microsoft.com/keys/microsoft.asc
dnf install -y https://packages.microsoft.com/config/rhel/10/packages-microsoft-prod.rpm
dnf install -y azure-cli
Comment on lines +520 to +523

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

for key in \
  https://packages.microsoft.com/keys/microsoft.asc \
  https://packages.microsoft.com/keys/microsoft-2025.asc \
  https://packages.microsoft.com/rhel/10/prod/repodata/repomd.xml.key
do
  echo "== ${key} =="
  curl -fsSL "${key}" | gpg --show-keys --with-colons | awk -F: '$1=="pub" {print}'
done

Repository: devfile/developer-images

Length of output: 291


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "Dockerfile context:"
sed -n '510,530p' universal/ubi10/Dockerfile

echo
echo "Check package availability:"
command -v curl || true
command -v rpm || true
command -v gpg || true

echo
echo "Public key fetch and fingerprint headers without local gpg:"
for key in \
  https://packages.microsoft.com/keys/microsoft.asc \
  https://packages.microsoft.com/keys/microsoft-2025.asc \
  https://packages.microsoft.com/rhel/10/prod/repodata/repomd.xml.key
do
  echo "== ${key} =="
  curl -fsSL "${key}" | od -An -tx1 -N256 | tr -d ' \n' | sed 's/^/'"${key}"': /'
  echo
done

echo
echo "Fetch Microsoft Rhel 10 repo RPM metadata key and inspect with rpm if available:"
rm -f /tmp/microsoft-rhel-10.gpg
curl -fsSL https://packages.microsoft.com/rhel/10/prod/repodata/repomd.xml.key -o /tmp/microsoft-rhel10-repomd.xml.key
if command -v rpm >/dev/null 2>&1; then
  rpm -qip /tmp/microsoft-rhel10-repomd.xml.key 2>/dev/null || true
else
  echo "rpm not available"
fi

Repository: devfile/developer-images

Length of output: 1042


🌐 Web query:

Microsoft Azure CLI RHEL 10 install DNF microsoft.asc microsoft-2025.asc

💡 Result:

To install the Azure CLI on Red Hat Enterprise Linux (RHEL) 10, you must use the Microsoft repository key specifically designated for repositories created after April 2025, which is microsoft-2025.asc [1][2]. As of July 2026, the official installation process involves the following steps [3][4]: 1. Import the correct Microsoft repository GPG key for RHEL 10 [3][4]: sudo rpm --import https://packages.microsoft.com/keys/microsoft-2025.asc 2. Install the Microsoft repository configuration package for RHEL 10 to enable the required package source [3]: sudo dnf install -y https://packages.microsoft.com/config/rhel/10/packages-microsoft-prod.rpm 3. Install the Azure CLI package using dnf [3][4]: sudo dnf install azure-cli Regarding the GPG keys: - microsoft-2025.asc: This is the required key for RHEL 10 repositories [1][2]. It corresponds to the public key fingerprint AA86 F75E 427A 19DD 3334 6403 EE4D 7792 F748 182B [1][2]. - microsoft.asc: This is the original key used for older distributions (e.g., RHEL 9 and earlier) created before May 2025 and should not be used for RHEL 10 [1][2]. Always prefer using the configuration package (packages-microsoft-prod.rpm) from https://packages.microsoft.com/config/rhel/10/ to ensure the repository is configured with the correct GPG key and base URLs automatically [1].

Citations:


🌐 Web query:

packages.microsoft.com github RHEL 10 packages-microsoft-prod RPM GPG key

💡 Result:

RHEL 10 is supported by Microsoft's Linux package repositories [1][2]. Unlike earlier RHEL versions, RHEL 10 requires a newer GPG signing key due to updated security requirements [3][2]. Repository Configuration Microsoft provides a specific repository configuration package for RHEL 10. You can download and install it using the following commands: # Download the RHEL 10 repository configuration package curl -sSL -O https://packages.microsoft.com/config/rhel/10/packages-microsoft-prod.rpm # Install the repository configuration package sudo rpm -i packages-microsoft-prod.rpm GPG Keys for RHEL 10 RHEL 10 packages are signed with a newer Microsoft GPG key (RSA-4096), which is distinct from the older microsoft.asc key used for RHEL 8 and RHEL 9 [3][2]. 1. New RHEL 10 Key: The key for RHEL 10 is typically imported automatically when using the repository configuration package above. If you need to import it manually, it is available at: https://packages.microsoft.com/rhel/10/prod/repodata/repomd.xml.key 2. Legacy Key: The legacy key (microsoft.asc) is still required for certain products (such as Microsoft Edge) that have not yet migrated to the new signing infrastructure [3]. - Legacy Key URL: https://packages.microsoft.com/keys/microsoft.asc - Command: sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc Key Details for Verification - New GPG Public Key (for repositories created after April 2025): - URL: https://packages.microsoft.com/keys/microsoft-2025.asc - Fingerprint: AA86 F75E 427A 19DD 3334 6403 EE4D 7792 F748 182B [4][5] For further details on repository structure, you can browse the official RHEL 10 repository index at https://packages.microsoft.com/rhel/10/prod/ [6].

Citations:


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "Fetch keys with HTTP headers/length:"
for key in \
  https://packages.microsoft.com/keys/microsoft.asc \
  https://packages.microsoft.com/keys/microsoft-2025.asc \
  https://packages.microsoft.com/rhel/10/prod/repodata/repomd.xml.key
do
  echo "== ${key} =="
  (timeout 20 curl -sSIL "${key}" || true | sed -n '1,20p')
  (timeout 20 curl -fsSL "${key}" >/tmp/key.bin 2>/tmp/key.err && wc -c /tmp/key.bin && hexdump -C /tmp/key.bin | sed -n '1,20p') || echo "curl failed: $(cat /tmp/key.err)"
  echo
done

echo "Locate related documentation/config in repo for expected signature keys:"
rg -n "microsoft-(2025|asc)|packages-microsoft-prod|rpm --import|repomd.xml" . || true

Repository: devfile/developer-images

Length of output: 1447


🌐 Web query:

site:learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux pivots=dnf RHEL 10 microsoft.asc microsoft-2025.asc

💡 Result:

For RHEL 10, the correct GPG key to import for Microsoft repositories is microsoft-2025.asc [1]. You should import this key using the following command: sudo rpm --import https://packages.microsoft.com/keys/microsoft-2025.asc The older microsoft.asc key is used for lower versions of RHEL, not RHEL 10 [1]. To add the Microsoft repository for RHEL 10, use the official packages-microsoft-prod.rpm file rather than manual configuration files [1]: sudo dnf install -y https://packages.microsoft.com/config/rhel/10/packages-microsoft-prod.rpm There is no documented usage of a pivots=dnf configuration parameter in standard RHEL 10 dnf repository setups or Microsoft repository installation instructions.

Citations:


Use the RHEL 10 Microsoft signing key.

The Azure CLI RHEL 10 dnf install path imports microsoft.asc, which is the legacy key. Import the RHEL 10 key before installing the Microsoft repo, or omit the explicit import if the packages-microsoft-prod.rpm installs/importing the newer key.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@universal/ubi10/Dockerfile` around lines 520 - 523, Update the Azure CLI
installation block to use the RHEL 10 Microsoft signing key before installing
the repository package, or remove the explicit key import if
packages-microsoft-prod.rpm reliably installs the newer key. Ensure the
subsequent dnf install of azure-cli uses the RHEL 10 repository configuration.

Source: MCP tools

dnf clean all
rm -rf /var/cache/dnf
;;
ppc64le)
echo "Skipping Azure CLI installation for unsupported architecture: $TARGETARCH"
;;
*)
echo "Skipping Azure CLI installation for unsupported architecture: $TARGETARCH"
;;
esac
EOF

# e2fsprogs setup
# Since e2fsprogs-static package has removed RHEL 8 distribution, it is not possible to install from the repository
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages
Expand Down Expand Up @@ -615,13 +637,22 @@ chmod +x /usr/local/bin/herdr
EOF

RUN <<EOF
set -euf -o pipefail
oc completion bash > /usr/share/bash-completion/completions/oc
tkn completion bash > /usr/share/bash-completion/completions/tkn
kubectl completion bash > /usr/share/bash-completion/completions/kubectl
cat ${NVM_DIR}/bash_completion > /usr/share/bash-completion/completions/nvm
if [ -f /usr/local/google-cloud-sdk/completion.bash.inc ]; then
cat /usr/local/google-cloud-sdk/completion.bash.inc > /usr/share/bash-completion/completions/gcloud
fi
if command -v az &> /dev/null; then
set +e
az completion bash > /usr/share/bash-completion/completions/az
if [ \$? -ne 0 ]; then
echo "Warning: az completion generation failed"
fi
set -e
fi
EOF

## Add sdkman's init script launcher to the end of ${PROFILE_EXT} since we are not adding it on sdkman install
Expand Down
31 changes: 31 additions & 0 deletions universal/ubi9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,28 @@ EOF

ENV PATH="/usr/local/google-cloud-sdk/bin:${PATH}"

## Azure CLI
RUN <<EOF
set -euf -o pipefail

case "$TARGETARCH" in
amd64|arm64)
# Azure CLI installation for amd64 and arm64
rpm --import https://packages.microsoft.com/keys/microsoft.asc
dnf install -y https://packages.microsoft.com/config/rhel/9/packages-microsoft-prod.rpm
dnf install -y azure-cli
dnf clean all
rm -rf /var/cache/dnf
;;
ppc64le)
echo "Skipping Azure CLI installation for unsupported architecture: $TARGETARCH"
;;
*)
echo "Skipping Azure CLI installation for unsupported architecture: $TARGETARCH"
;;
esac
EOF

# e2fsprogs setup
# Since e2fsprogs-static package has removed RHEL 8 distribution, it is not possible to install from the repository
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages
Expand Down Expand Up @@ -582,13 +604,22 @@ chmod +x /usr/local/bin/herdr
EOF

RUN <<EOF
set -euf -o pipefail
oc completion bash > /usr/share/bash-completion/completions/oc
tkn completion bash > /usr/share/bash-completion/completions/tkn
kubectl completion bash > /usr/share/bash-completion/completions/kubectl
cat ${NVM_DIR}/bash_completion > /usr/share/bash-completion/completions/nvm
if [ -f /usr/local/google-cloud-sdk/completion.bash.inc ]; then
cat /usr/local/google-cloud-sdk/completion.bash.inc > /usr/share/bash-completion/completions/gcloud
fi
if command -v az &> /dev/null; then
set +e
az completion bash > /usr/share/bash-completion/completions/az
if [ \$? -ne 0 ]; then
echo "Warning: az completion generation failed"
fi
set -e
fi
EOF

## Add sdkman's init script launcher to the end of ${PROFILE_EXT} since we are not adding it on sdkman install
Expand Down
Loading