linux - dockerfile中的yum-没有启用的存储库

标签 linux maven docker yum

我在dockerfile中使用yum安装python3时遇到问题。我确实在互联网上看过,但是我尝试了一些尝试,但是没有用。它只是一件小事,但无法弄清楚。当我尝试在docker文件下构建时,出现错误。我在行上遇到错误-

运行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>

docker文件在下面。

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"]

最佳答案

为什么要混合aptyum?您已经在使用apt-get,也可以使用它来安装python:

apt-get install python3.6

关于linux - dockerfile中的yum-没有启用的存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60621515/

相关文章:

java - 滑动菜单和 Maven

docker - 如何自动缩放 Docker 容器主机?

ruby-on-rails - 在 Azure 中通过 Docker bash 运行 Rails CLI 命令

c - 使用 setsockopt;当套接字从另一端关闭时,read 返回 0 而不是 -1

linux - Bash:如何检查命令是否及时执行

linux - 你如何从/dev/input/mice 读取鼠标按钮状态?

linux - 如何将 stat 的输出传递给 touch?

java - 如果某个文件已经存在,如何禁用 antrun?

spring - 无法启动 cucumber 简单测试

docker - Linux Docker容器中的Application Insights SDK代理?