Dockerfile Mariadb

hello everyone i want to create a docker image from centos 7 with mariadb installed and running. the image created but mariadb won’t start. can anyone please help me.

This Is My Dockerfile.
#######################
FROM centos:7

MAINTAINER HAMZA_BENHAMANI

RUN yum install mariadb-server -y \

EXPOSE 3306

CMD [“mysqld”]
#######################

Thanks.

I have two suggestions for you:
1… Study the Github pages of the official Mariadb image and see what needs to be done.
2. Study the Dockerfile reference to understand each instrcution.

Good luck!

1 Like

Okay thanks. I will try.

So i found how to do it.
this is my Dockerfile update.

############################
FROM centos:7

MAINTAINER HAMZA_BENHAMANI
RUN yum install mariadb-server -y
RUN /usr/libexec/mariadb-prepare-db-dir mariadb.service
EXPOSE 3306

CMD [“mysqld_safe”]
##############################