Running mysql in the foreground in centos

2019-04-29 16:45发布

问题:

I am building a docker image for a mysql database. For that purpose, I have to run mysql in the foreground and not as a deamon service. I am using a centos base image. How to run mysql in the foreground?

回答1:

If you run mysqld_safe

CMD ["mysqld_safe"]

The process should be in the foreground and blocking.

However as the comments above suggest, there are several official supported MySQL containers which you should consider using.