How to automatically start a service when running a docker container

0 votes

I have a Dockerfile that I use to install MySQL server in a container, which I then run as follows:

sudo docker run -t -i 09d18b9a12be /bin/bash


However, the MySQL service does not start by itself; I must manually start it (from within the container):

service mysql start


When I run the docker container, how do I start the MySQL service automatically?

Apr 30, 2022 in Docker by rajiv
• 1,620 points

edited 4 days ago 3 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP