Tag Archives: docker

How to run a MariaDB local docker container ?

I’m developing on Windows software solutions targeting debian servers, and relying on MariaDB databases, whose versions vary a lot.

Docker is great to reproduce a production environment, and eliminate common issues related to versioning, or OS specificities (yes, I’m think about case sensitivity in table names on linux, which doesn’t occur on Windows).

So, here is a simple docker command to start a mariadb 10.3 container available on local port 3310 (as explained in details by the MariaDB team here):

docker run -p 3310:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=myRootPassword -d mariadb/server:10.3

Docker cheat sheet

A few commands commonly used to create, configure, or access docker containers

Start a new MariaDB container:

docker run -p 3306:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=MyRootPassword -d mariadb/server:10.3

SSH to a running docker container

docker exec -it  <container name> /bin/bash

View running containers:

docker ps

View stopped/inactive containers:

docker ps -a