Skip to content

Commit

Permalink
Update dockerfile to install azure-cli using dnf
Browse files Browse the repository at this point in the history
Avoids architecture issues such as "bash: /usr/bin/az: cannot execute: required file not found"

Signed-off-by: Naga Ravi Chaitanya Elluri <[email protected]>
  • Loading branch information
chaitanyaenr committed Jul 3, 2024
1 parent ce9f8aa commit 6ae17cf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions containers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# azure-client
FROM mcr.microsoft.com/azure-cli:latest as azure-cli
# oc build
FROM golang:1.22.4 AS oc-build
RUN apt-get update && apt-get install -y libkrb5-dev
Expand Down Expand Up @@ -30,8 +28,9 @@ RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/s

# This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
RUN dnf update && dnf install -y git python39 jq yq gettext wget which
# copy azure client binary from azure-cli image
COPY --from=azure-cli /usr/local/bin/az /usr/bin/az

# Install azure cli
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc && dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm && dnf install -y azure-cli

# copy oc client binary from oc-build image
COPY --from=oc-build /tmp/oc/oc /usr/bin/oc
Expand Down

0 comments on commit 6ae17cf

Please sign in to comment.