mysqldockerdebiandockerfile

Writing a dockerfile containing a custon mysql installation


I want to write a dockerfile where I install a custom mysqlserver with user + password.

My command looks like this at the moment:

RUN apt-get install -y mysql-server \
    -y mysql-client

can I specify the input vars as running parameter of the

docker build process?

Any ideas?

thanks


Solution

  • Ok, so user2915097 has mentioned a nice option to you, but if you still want to create a separate image, you might proceed with the following pointers.

    1. Figure out how to install mysql using a bash script (No manual input needed). This link might help.
    2. In Dockerfile, either run that script in Dockerfile itself, or save the script seperatly -> use COPY to copy it in the docker image -> run the script using a Dockerfile instruction in container.

    I think this is all you need to work on for now.