Question about mysql and docker

Hi everyone,

I’m in front of a serious issue,

I want to create a container with mysql inside without usage of the mysql official image. So, to do that, i’m making a Dockerfile and building it, but when comes the installation of mysql packages, bash asks me about mysql root password.

Issue is i can’t type the password and press Enter, because if i do that, it just happens nothing.

Is it possible to pass through this asking ?

Thanks for your advices.

Sorry for my bad english, i’m trying to do my best.


Hi chronoxyde,

You can refer to the Dockerfiles that build the official images:

Thanks, i already tried, but i want to use the apt-get install mysql-server so i continue my research.

Thank You

Hi cronoxyde,

The official Dockerfiles use apt-get install -y mysql-server:

The password is handled by:

Thank you very very much ! I had troubles to understand how they change the password but with those lines it’s more easier, i’m trying to do it with DEBIANfrontend=noninteractive command line and it’s successfull ! Another thing is the comprehension of the SQL language but it’s another problem.

Thnaks a lot again !! :smile: