</code></pre></div><p>These settings can be mixed and matched with Docker ENV settings as you require, but the settings in the file will always take precedence.</p><h3id=bootstrapping-a-new-instance>Bootstrapping a new instance</h3><p>We support a one time run of custom sql files on init. In order to use this place <code>*.sql</code> files in:</p><p><divclass=highlight><pre><span></span><code>/config/initdb.d/
</code></pre></div> This will have the same effect as setting the <code>REMOTE_SQL</code> environment variable. The sql will only be run on the containers first boot and setup.</p><h3id=upgrading>Upgrading</h3><p>When this container initializes, if <code>MYSQL_ROOT_PASSWORD</code> is set an upgrade check will run. If an upgrade is required the log will indicate the need to run:</p><divclass=highlight><pre><span></span><code>mariadb-upgrade -u root -p<PASSWORD>
</code></pre></div><h2id=usage>Usage</h2><p>To help you get started creating a container from this image you can either use docker-compose or the docker cli.</p><h3id=docker-compose-recommended-click-here-for-more-info>docker-compose (recommended, <ahref=https://docs.linuxserver.io/general/docker-compose>click here for more info</a>)</h3><divclass=highlight><pre><span></span><code><spanclass=nn>---</span>
</code></pre></div><h3id=docker-cli-click-here-for-more-info>docker cli (<ahref=https://docs.docker.com/engine/reference/commandline/cli/>click here for more info</a>)</h3><divclass=highlight><pre><span></span><code>docker<spanclass=w></span>run<spanclass=w></span>-d<spanclass=w></span><spanclass=se>\</span>
</code></pre></div><h2id=parameters>Parameters</h2><p>Docker images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <code><external>:<internal></code> respectively. For example, <code>-p 8080:80</code> would expose port <code>80</code> from inside the container to be accessible from the host's IP on port <code>8080</code> outside the container.</p><h3id=ports-p>Ports (<code>-p</code>)</h3><table><thead><tr><thalign=center>Parameter</th><th>Function</th></tr></thead><tbody><tr><tdalign=center><code>3306</code></td><td>Mariadb listens on this port.</td></tr></tbody></table><h3id=environment-variables-e>Environment Variables (<code>-e</code>)</h3><table><thead><tr><thalign=center>Env</th><th>Function</th></tr></thead><tbody><tr><tdalign=center><code>PUID=1000</code></td><td>for UserID - see below for explanation</td></tr><tr><tdalign=center><code>PGID=1000</code></td><td>for GroupID - see below for explanation</td></tr><tr><tdalign=center><code>TZ=Etc/UTC</code></td><td>specify a timezone to use, see this <ahref=https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List>list</a>.</td></tr><tr><tdalign=center><code>MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD</code></td><td>Set this to root password for installation (minimum 4 characters & non-alphanumeric passwords must be properly escaped).</td></tr><tr><tdalign=center><code>MYSQL_DATABASE=USER_DB_NAME</code></td><td>Specify the name of a database to be created on image startup.</td></tr><tr><tdalign=center><code>MYSQL_USER=MYSQL_USER</code></td><td>This user will have superuser access to the database specified by MYSQL_DATABASE (do not use root here).</td></tr><tr><tdalign=center><code>MYSQL_PASSWORD=DATABASE_PASSWORD</code></td><td>Set this to the password you want to use for you MYSQL_USER (minimum 4 characters & non-alphanumeric passwords must be properly escaped).</td></tr><tr><tdalign=center><code>REMOTE_SQL=http://URL1/your.sql,https://URL2/your.sql</code></td><td>Set this to ingest sql files from an http/https endpoint (comma seperated array).</td></tr></tbody></table><h3id=volume-mappings-v>Volume Mappings (<code>-v</code>)</h3><table><thead><tr><thalign=center>Volume</th><th>Function</th></tr></thead><tbody><tr><tdalign=center><code>/config</code></td><td>Contains the db itself and all assorted settings.</td></tr></tbody></table><h4id=miscellaneous-options>Miscellaneous Options</h4><table><thead><tr><thalign=center>Parameter</th><th>Function</th></tr></thead><tbody><tr><td></td><td></td></tr></tbody></table><h2id=environment-variables-from-files-docker-secrets>Environment variables from files (Docker secrets)</h2><p>You can set any environment variable from a file by using a special prepend <code>FILE__</code>.</p><p>As an example:</p><divclass=highlight><pre><span></span><code>-e<spanclass=w></span><spanclass=nv>FILE__PASSWORD</span><spanclass=o>=</span>/run/secrets/mysecretpassword
</code></pre></div><p>Will set the environment variable <code>PASSWORD</code> based on the contents of the <code>/run/secrets/mysecretpassword</code> file.</p><h2id=umask-for-running-applications>Umask for running applications</h2><p>For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional <code>-e UMASK=022</code> setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up <ahref=https://en.wikipedia.org/wiki/Umask>here</a> before asking for support.</p><h2id=user-group-identifiers>User / Group Identifiers</h2><p>When using volumes (<code>-v</code> flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user <code>PUID</code> and group <code>PGID</code>.</p><p>Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.</p><p>In this instance <code>PUID=1000</code> and <code>PGID=1000</code>, to find yours use <code>id user</code> as below:</p><divclass=highlight><pre><span></span><code><spanclass=w></span>$<spanclass=w></span>id<spanclass=w></span>username