Docker Community Forums

Share and learn in the Docker community.

Question about mysql and docker


(Chronoxyde) #1

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.

@Chronoxyde


(Jerry Baker) #2

Hi chronoxyde,

You can refer to the Dockerfiles that build the official images: https://github.com/docker-library/mysql


(Chronoxyde) #3

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

Thank You


(Jerry Baker) #4

Hi cronoxyde,

The official Dockerfiles use apt-get install -y mysql-server: https://github.com/docker-library/mysql/blob/master/5.7/Dockerfile#L29

The password is handled by: https://github.com/docker-library/mysql/blob/master/5.7/Dockerfile#L25-L26


(Chronoxyde) #5

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: