Home > front end >  How to install vim in a docker image based on mysql version 8?
How to install vim in a docker image based on mysql version 8?

Time:07-13

I had been using mysql version 5.7 and this was working.

Dockerfile (working)

FROM mysql:5.7

...

RUN yum update -y; yum install -y vim

Then I upgraded to mysql 8 and now I'm getting this error.

$ 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 (not working)

FROM mysql:8

...

RUN yum update -y; yum install -y vim

CodePudding user response:

If you take a look at the Tag for 8.0 you can see that the base uses a different version of Oracle linux (8 vs 7). Yum is not installed in 8. Instead, there's a minimal installer (microdnf). So this substitution should work for you:

microdnf install -y vim
  • Related