1

I am trying to host a web server via docker.The web server needs mysql database.But I am failing to change the root password of mysql and also start the mysql and apache2 service.

So can someone help me to set the root password and start start the services.

Here is my try to setup the docker container.

FROM ubuntu:16.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install apache2
RUN apt-get -q -y install mysql-server

CMD service mysql start
Arijit Panda
  • 1,581
  • 2
  • 17
  • 36
  • I would recommend you to decouple your apache and mysql with two separate docker image for better management. You can use docker-compose to link these two images. Here is docker image for mysql with step to setup root password https://hub.docker.com/_/mysql/. In case that you want to carry with your approach, here is link to duplicate question https://stackoverflow.com/questions/16556497/how-to-reset-or-change-the-mysql-root-password – sayboras Dec 28 '17 at 03:32
  • I initially thought about that. But that will become bit complex for the user of my docker container. – Arijit Panda Dec 28 '17 at 03:42
  • Noted. Hope that you can change root password by using script now. – sayboras Dec 28 '17 at 08:49

0 Answers0