MariaDB preloaded with a sample database
344
This Docker image provides the latest version of MariaDB server (11.6.2+maria~ubu2404) preloaded with MySQL's "employee" test database.
You can also find the database dump here: MariaDB Sample Database Dump
To start a container from this image:
# Create a new network (if not already existing)
docker network create some-network
# Start the MariaDB server with sample data
docker run --detach \
--network some-network \
--name some-mariadb \
--env MARIADB_USER=example-user \
--env MARIADB_PASSWORD=my_cool_secret \
--env MARIADB_ROOT_PASSWORD=my-secret-pw \
--env MARIADB_DATABASE=employees \
agentlans/mariadb-sample
# Check that the server is running
docker ps -a | grep some-mariadb
Once the container is running, you can access it from another container on the same network. In this case, the database connection details are:
some-mariadbexample-usermy_cool_secretemployees3306 (the default for MariaDB and MySQL)To access the MariaDB database running in the container:
docker exec -it \
--env MARIADB_USER=example-user \
--env MARIADB_PASSWORD=my_cool_secret \
--env MARIADB_DATABASE=employees \
some-mariadb sh -c 'mariadb -u $MARIADB_USER -p$MARIADB_PASSWORD $MARIADB_DATABASE'
Important
Any changes made to the database will not be saved when the container is shut down.
# Stop the container
docker stop some-mariadb
# Delete the container
docker rm some-mariadb
Content type
Image
Digest
sha256:35dd44896…
Size
150.7 MB
Last updated
over 1 year ago
docker pull agentlans/mariadb-sample