diff --git a/Dockerfile b/Dockerfile index a599ec551c0c925f085f19b10cab50925d7e1296..d43ced3f6525b4351a73ac606ab47f0cf133bac6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,11 +28,10 @@ RUN groupadd -r mysql && \ dnf clean all && \ rm -rf /var/cache/dnf && \ rm mariadb-server.rpm mariadb-client.rpm mariadb-common.rpm mariadb-shared.rpm galera.rpm boost.rpm RPM-GPG-KEY-MariaDB RPM-GPG-KEY-CentOS-Official && \ + rm usr/lib64/mysql/plugin/auth_pam_tool_dir/auth_pam_tool && \ chmod +x /usr/local/bin/docker-entrypoint.sh && \ ln -s usr/local/bin/docker-entrypoint.sh -VOLUME /var/lib/mysql - USER mysql HEALTHCHECK --interval=5s --timeout=30s CMD mysqladmin ping -h 127.0.0.1 -u mysql || exit 1 diff --git a/README.md b/README.md index 40a179ee4cc42becbab277a3ea1f0bb61167e432..bf18b0cdc725c8782c7fabb780814ea1fbbdcf85 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,33 @@ The following MariaDB documentation provides an introduction, primer, list of SQ ## Usage -Use the `kubectl` command to run MariaDB within your cluster: +Run MariaDB while mounting your own data directory setting your passwords (**Set these passwords to your own**): ``` -kubectl run mariadb --image=mariadb:*tag* --generator=run-pod/v1 --image-pull-policy=Never +### Set these passwords to your own +docker run --name mariadb -v /your/own/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root-secret-pw -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql-secret-pw -d mariadb:*tag* +### ``` -Execute commands within the container: +Exec into the shell of the container: ``` -kubectl exec -it pod/mariadb -- mysql +docker exec -it mariadb bash ``` -Run your statements and queries: +Log in to start using: ``` -# example +mysql -u mysql -p +``` + +## Notes + +The following links provide additional tips for running MariaDB on Docker: + +- [DockerHub: MariaDB Install Instructions](https://hub.docker.com/_/mariadb) +- [GitHub: MariaDB 10.5](https://github.com/docker-library/mariadb/tree/master/10.5) + +The following links provide additional tips for running MariaDB on Kubernetes: -show databases; -``` \ No newline at end of file +- [An Introduction to Kubernetes Secrets and ConfigMaps](https://opensource.com/article/19/6/introduction-kubernetes-secrets-and-configmaps) +- [Run a Single-Instance Stateful Application](https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/) +- [Example: Deploying WordPress and MySQL with Persistent Volumes](https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/) +- [Deploy a Production-Ready MariaDB Cluster on Kubernetes with Bitnami and Helm](https://engineering.bitnami.com/articles/deploy-a-production-ready-mariadb-cluster-on-kubernetes-with-bitnami-and-helm.html) +- [How to Set Up MySQL Kubernetes Deployments with Cloud Volumes](https://cloud.netapp.com/blog/how-to-set-up-mysql-kubernetes-deployments) +- [How to Run HA MariaDB on Google Kubernetes Engine](https://portworx.com/run-ha-mariadb-google-kubernetes-engine/) \ No newline at end of file