Database popular among developers.
Get container pull.
docker pull "mariadb"
Create network for data.
docker network create "mariadb"
Create volume for data.
docker volume create "mariadb"
ln -s "/var/lib/docker/volumes/mariadb" "/data/volume/"
Create and run container.
docker run --name "mariadb" \
-p 3306:3306 \
--network "mariadb" \
-v "mariadb":"/var/lib/mariadb" \
-e MARIADB_ROOT_PASSWORD="master" \
--restart=always \
-d "mariadb":"latest"
Database access "MARIADB_ROOT_PASSWORD".
Start container.
docker start "mariadb"
Access container.
docker exec -it "mariadb" "/bin/bash"
Top comments (0)