【问题标题】:How to install vim in a docker image based on mysql version 8?如何在基于 mysql 版本 8 的 docker 镜像中安装 vim?
【发布时间】:2022-07-12 23:39:56
【问题描述】:

我一直在使用 mysql 5.7 版,并且可以正常工作。

Dockerfile(工作)

FROM mysql:5.7

...

RUN yum update -y; yum install -y vim

然后我升级到 mysql 8,现在我得到了这个错误。

$ gnt build

...

#5 [ 2/12] RUN yum update -y; yum install -y vim
#5 sha256:a564337cc7df72796c4c967652d420ef76ec98034de106834a473bceb4889532
#5 0.325 /bin/sh: yum: command not found
#5 0.326 /bin/sh: yum: command not found
#5 ERROR: executor failed running [/bin/sh -c yum update -y; yum install -y vim]: exit code: 127
------
 > [ 2/12] RUN yum update -y; yum install -y vim:
------
executor failed running [/bin/sh -c yum update -y; yum install -y vim]: exit code: 127

> Task :Server-mysql:buildDockerImage FAILED

FAILURE: Build failed with an exception.

Dockerfile(不工作)

FROM mysql:8

...

RUN yum update -y; yum install -y vim

【问题讨论】:

    标签: mysql docker dockerfile


    【解决方案1】:

    如果您查看 8.0 的标记,您会发现基础使用不同版本的 Oracle linux(8 与 7)。 Yum 没有安装在 8 中。相反,有一个最小的安装程序 (microdnf)。所以这个替换应该适合你:

    microdnf install -y vim
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-16
      • 1970-01-01
      • 2022-10-04
      相关资源
      最近更新 更多