简体   繁体   中英

Dockerfile running from Mysql cannot access apt-get

When I run docker-compose up to install our MySQL server, I get the following error:

RUN apt-get -y update && apt-get upgrade -y:
/bin/sh: apt-get: command not found

from the relevant dockerfile code:

FROM mysql:5.7

RUN apt-get -y update && apt-get upgrade -y

This used to work fine a few months ago for my coworkers.

Apparently since Oracle bought MySQL in 2010, they have been converting everything over to their proprietary OS. In the last few months, they switched the default mysql package to Oracle OS from Debian.

See the packages here: https://hub.docker.com/_/mysql

You now need to specify the debian package like:

FROM mysql:5.7-debian

RUN apt-get -y update && apt-get upgrade -y

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM