Coder Social home page Coder Social logo

alpine-mariadb's Introduction

Alpine-MARIADB (x86_64)

This is a Docker Container that uses alpine 3.6, adds s6 overlay(process manager), installs latest mariadb, mariadb-client.

MariaDB is a drop-in replacement for MySQL server. For more information please see MariaDB

Prerequisites

Any OS supporting Docker, I prefer Linux.

Docker

Installing

Assuming you have Docker configured correctly, simply pull my image.

Step 1)

$ docker pull rjarow/alpine-mariadb

Deploying

There are a few ways to deploy this, I would suggest using the -v volume mount to point to your application that needs to be hosted. The DB's are stored in /var/lib/mysql

The mysql user in the container UID/GIDD can be changed by passing environment variables, PUID and PGID. If not set, these default to UID 1050.

There are also VERY useful environment variables that can be used to setup a new db, user, and password on first launch.

MYSQL_ROOT_PASSWORD - Set this to set the mysql root password
MYSQL_DATABASE - Set this to the database you'd like to be created
MYSQL_USER - Set this to the username you'd like to use to access the database
MYSQL_PASSWORD - Set this to set the username's password to access the database.

Knowing these options here is an example of running as your current user. Example:

docker create --name mariadb -v $(pwd):/var/lib/mysql \
-e PUID=$(id -u) \
-e PGID=$(id -u) \
-e MYSQL_ROOT_PASSWORD=rootpass \
-e MYSQL_DATABASE=mydbname \
-e MYSQL_USER=myuser \
-e MYSQL_PASSWORD=mypassword \
rjarow/alpine-mariadb
docker container start mariadb

This image exposes port 3306 to connect to mariadb server.

If you want to bind this to the hosts port 3306 the example would change slightly.

docker create --name mariadb -v $(pwd):/var/lib/mysql \
-e PUID=$(id -u) \
-e PGID=$(id -u) \
-e MYSQL_ROOT_PASSWORD=rootpass \
-e MYSQL_DATABASE=mydbname \
-e MYSQL_USER=myuser \
-e MYSQL_PASSWORD=mypassword \
-p 3306:3306 \
rjarow/alpine-mariadb

There are many ways you can deploy this, including Docker Compose, so have fun with it. :)

Built With

Base image is built from scratch using alpine's source, and is maintained by me.

Base Image

Authors

Initial work - rjarow

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

  • Everyone making beautiful & efficient Docker Images
  • Hi Mom!

alpine-mariadb's People

Contributors

rjarow avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.