How to run MariaDB inside Docker and connect to it with Spring Boot Docker with MariaDB We’ll use yobasystems/alpine-mariadb, a lightweight container image using the open-source MariaDB as MySQL alternative. Here’s the docker command: docker run --name mariadb -p 33067:3306 -v /var/lib/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root_pass -d yobasystems/alpine-mariadb The command will create a container named mariadb with a root password (root_pass). You can connect to the database via localhost on port 33067.