我一直在使用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
如果你看一下8.0的标签,你会发现基础使用的是不同版本的Oracle linux (8 vs 7)。取而代之的是一个最小的安装程序(microdnf)。所以这个替换应该对你有用:
microdnf install -y vim