Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 209
Ian Avatar asked Jan 23 '26 17:01

Ian


1 Answers

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
like image 152
Ian Avatar answered Jan 25 '26 09:01

Ian