I am having issues with installing python3 with yum in dockerfile. I did look on internet, I did try few things, not working. Its just small thing but not able to figure it out. When I try to build below docker file I do get error . I get error at line –
RUN yum install -y oracle-epel-release-el7
There are no enabled repos. Run "yum repolist all" to see the repos you have. You can enable repos with yum-config-manager --enable <repo>
The docker file is below.
FROM openjdk:13-jdk-slim ARG MAVEN_VERSION=3.6.3 ARG USER_HOME_DIR="/root" ARG SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0 ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries # Install prerequisites RUN apt-get update && apt-get install -y curl RUN apt-get update && apt-get install -y yum RUN mkdir -p /usr/share/maven /usr/share/maven/ref && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz && echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 && rm -f /tmp/apache-maven.tar.gz && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn ENV MAVEN_HOME /usr/share/maven ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2" # Install Python 3.6 RUN yum install -y oracle-epel-release-el7 RUN yum install -y python36 # Install AWS CLI RUN pip3 install awscli CMD ["/bin/bash"]
Advertisement
Answer
Why mix apt
and yum
? You’re already using apt-get
, just use it to install your python too:
apt-get install python3.6