Home:ALL Converter>Installing MariaDB on top of Ubuntu via Dockerfile

Installing MariaDB on top of Ubuntu via Dockerfile

Ask Time:2020-05-04T17:50:51         Author:wesdork

Json Formatter

So I have a problem. I am using Docker CE on Windows 10 and I am trying to install MariaDB on top of Ubuntu using Dockerfile.

This is how my Dockerfile looks like:

FROM ubuntu:18.04

RUN groupadd -r mysql && useradd -r -g mysql mysql

RUN apt-get update && apt-get install -y \
mariadb-server mariadb-client

This is how it looks like, then I would go into the container via interactive mode to run command such as "mysql -u root" but it would say

"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")"

Also, when building the image via Dockerfile, there would be these sentences that might be an error as well.

debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)

debconf: falling back to frontend: Readline

invoke-rc.d: could not determine current runlevel

invoke-rc.d: policy-rc.d denied execution of start.

Anyone has any idea how can I get pass all these issues? Rather, I would want to be able to run the command "mysql -u root" and some other commands via Dockerfile eventually. Right now I am manually doing it via interactive mode for docker run to see the error that it returns.

Thank you.

Author:wesdork,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/61589417/installing-mariadb-on-top-of-ubuntu-via-dockerfile
yy