Is there a way to install microdnf or dnf on amazonlinux:2 ?

1

I wanted to try to use Amazon Corretto so I tried

FROM maven:3.9.3-amazoncorretto-17
ARG CHROME_VERSION=113.0.5672.63-1
ADD google-chrome.repo /etc/yum.repos.d/google-chrome.repo
RUN microdnf install -y google-chrome-stable-$CHROME_VERSION \
    && sed -i 's/"$HERE\/chrome"/"$HERE\/chrome" --no-sandbox/g' /opt/google/chrome/google-chrome

Per https://hub.docker.com/layers/library/maven/3.9.3-amazoncorretto-17/images/sha256-51a8ceaec1ddb3237be298e8f31e794b0e047855d88d8ceae5dbb672606fe4a6 maven:3.9.3-amazoncorretto-17 has amazonlinux:2, 2.0.20230612.0 as a base image

However I get an error

[3/5] RUN microdnf install -y google-chrome-stable-113.0.5672.63-1  && sed -i 's/"$HERE\/chrome"/"$HERE\/chrome" --no-sandbox/g' /opt/google/chrome/google-chrome:
#7 2.618 /bin/sh: microdnf: command not found

I then tried (by adding RUN yum -y install microdnf) but I got:

[2/6] RUN yum -y install microdnf:                                                                                                                                                  
#5 2.536 Loaded plugins: ovl, priorities                                                                                                                                               
#5 27.24 9 packages excluded due to repository priority protections                                                                                                                    
#5 27.85 No package microdnf available.
#5 28.56 Error: Nothing to do

Is there a way to install microdnf (or dnf) for amazonlinux:2 ?

1개 답변
-1

Can you replace microdnf with yum?

AWS
전문가
Mike_L
답변함 일 년 전
  • Hi Mike, unfortunately when I replace microdnf with yum I get:

    executor failed running [/bin/sh -c yum install -y google-chrome-stable-$CHROME_VERSION 	&& sed -i 's/"$HERE\/chrome"/"$HERE\/chrome" --no-sandbox/g' /opt/google/chrome/google-chrome]: exit code: 1
    

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠