Host OS: Ubuntu 16.04 x86_64

Docker OS: Alpine Linux Edge

Docker version: 1.11.0, build 4dc5990

MariaDB version: 10.1.13

I try to install MariaDB via Dockerfile and start it on entrypoint (startup.sh), but can't do it.

All files (Dockerfile, my.cnf, startup.sh) and docker build . log are here: https://gist.github.com/rakshazi/1048c45ba7da181b9e87ed5ed4faef9b

What is wrong with my configs and how can i fix it?


Each RUN line in a Dockerfile gets executed as the only process in a container. The command you are running, mysql_install_db --verbose && /usr/bin/mysqladmin -u root password 'password', attempts to communicate with an already running mysql/mariadb server. Since this is the only thing running in the container, and there is no mysql service running, it fails.

Normally this sort of stuff should get run at runtime in an ENTRYPOINT script instead of at build time. This is because you'll want your mysql/mariadb files to be stored in a volume and not in the layered filesystem.

Answer by programmerq @ https://forums.docker.com/t/cant-build-container-with-mariadb/10256/2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy