-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
readme-vars.yml
171 lines (150 loc) · 8.12 KB
/
readme-vars.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
# project information
project_name: mariadb
project_url: "https://mariadb.org/"
project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/mariadb-git.png"
project_blurb: "[{{ project_name|capitalize }}]({{ project_url }}) is one of the most popular database servers. Made by the original developers of MySQL."
project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}"
# supported architectures
available_architectures:
- {arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
- {arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}
# container parameters
common_param_env_vars_enabled: true
param_container_name: "{{ project_name }}"
param_usage_include_env: true
param_env_vars:
- {env_var: "MYSQL_ROOT_PASSWORD", env_value: "ROOT_ACCESS_PASSWORD", desc: "Set this to root password for installation (minimum 4 characters & non-alphanumeric passwords must be properly escaped). (valid only for first run)"}
param_usage_include_vols: true
param_volumes:
- {vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Persistent config files"}
param_usage_include_ports: true
param_ports:
- {external_port: "3306", internal_port: "3306", port_desc: "MariaDB listens on this port."}
# optional container parameters
opt_param_usage_include_env: true
opt_param_env_vars:
- {env_var: "MYSQL_DATABASE", env_value: "USER_DB_NAME", desc: "Specify the name of a database to be created. (valid only for first run)"}
- {env_var: "MYSQL_USER", env_value: "MYSQL_USER", desc: "This user will have superuser access to the database specified by MYSQL_DATABASE (do not use root here). (valid only for first run)"}
- {env_var: "MYSQL_PASSWORD", env_value: "DATABASE_PASSWORD", desc: "Set this to the password you want to use for you MYSQL_USER (minimum 4 characters & non-alphanumeric passwords must be properly escaped). (valid only for first run)"}
- {env_var: "REMOTE_SQL", env_value: "http://URL1/your.sql,https://URL2/your.sql", desc: "Set this to ingest sql files from an http/https endpoint (comma seperated array)."}
readonly_supported: true
readonly_message: |
* `/tmp` must be mounted to tmpfs
* Not supported on first run
nonroot_supported: true
# application setup block
app_setup_block_enabled: true
app_setup_block: |
If you didn't set a password during installation, (see logs for warning) use
`mariadb-admin -u root -p<PASSWORD>`
to set one at the docker prompt...
NOTE changing any of the MYSQL_ variables after the container has set up the initial databases has no effect, use the mysqladmin tool or cli to make changes.
NOTE if you want to use (MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD) **all three** of these variables need to be set you cannot pick and choose.
Unraid users, it is advisable to edit the template/webui after setup and remove reference to this variable.
Find custom.cnf in /config for config changes (restart container for them to take effect)
, the databases in /config/databases and the log in /config/log/myqsl
### Loading passwords and users from files
The `MYSQL_ROOT_PASSWORD MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD REMOTE_SQL` env values can be set in a file:
```path
/config/env
```
Using the following format:
```env
MYSQL_ROOT_PASSWORD="ROOT_ACCESS_PASSWORD"
MYSQL_DATABASE="USER_DB_NAME"
MYSQL_USER="MYSQL_USER"
MYSQL_PASSWORD="DATABASE_PASSWORD"
REMOTE_SQL="http://URL1/your.sql,https://URL2/your.sql"
```
These settings can be mixed and matched with Docker ENV settings as you require, but the settings in the file will always take precedence.
### Bootstrapping a new instance
We support a one time run of custom sql files on init. In order to use this place `*.sql` files in:
```path
/config/initdb.d/
```
This will have the same effect as setting the `REMOTE_SQL` environment variable. The sql will only be run on the containers first boot and setup.
### Check and Repair
If user databases are not in a healthy state (sometimes caused by a failed upgrade), it may be remedied by running:
```shell
mariadb-check -u root -p<PASSWORD> -c -A # check all databases for errors
mariadb-check -u root -p<PASSWORD> -r -A # repair all databases
mariadb-check -u root -p<PASSWORD> -a -A # analyze all databases
mariadb-check -u root -p<PASSWORD> -o -A # optimize all databases
```
After running the above commands, you may need to run the upgrade command again.
### Upgrading
When this container initializes, if `MYSQL_ROOT_PASSWORD` is set an upgrade check will run. If an upgrade is required the log will indicate the need stop any services that are accessing databases in this container, and then run the command:
```shell
mariadb-upgrade -u root -p<PASSWORD>
```
# init diagram
init_diagram: |
"mariadb:latest": {
docker-mods
base {
fix-attr +\nlegacy cont-init
}
docker-mods -> base
legacy-services
custom services
init-services -> legacy-services
init-services -> custom services
custom services -> legacy-services
legacy-services -> ci-service-check
init-migrations -> init-adduser
init-os-end -> init-config
init-config -> init-config-end
init-crontab-config -> init-config-end
init-mariadb-initdb -> init-config-end
init-config -> init-crontab-config
init-mods-end -> init-custom-files
base -> init-envfile
init-config -> init-mariadb-config
init-mariadb-config -> init-mariadb-initdb
svc-mariadb -> init-mariadb-upgrade
base -> init-migrations
init-config-end -> init-mods
init-mods-package-install -> init-mods-end
init-mods -> init-mods-package-install
init-adduser -> init-os-end
init-envfile -> init-os-end
init-custom-files -> init-services
init-services -> svc-cron
svc-cron -> legacy-services
init-services -> svc-mariadb
svc-mariadb -> legacy-services
}
Base Images: {
"baseimage-alpine:3.21"
}
"mariadb:latest" <- Base Images
# changelog
changelogs:
- {date: "06.01.25:", desc: "Rebase to Alpine 3.21."}
- {date: "31.05.24:", desc: "Rebase to Alpine 3.20."}
- {date: "23.12.23:", desc: "Rebase to Alpine 3.19."}
- {date: "09.06.23:", desc: "Update lc_messages path in shipped custom.cnf to match upstream."}
- {date: "25.05.23:", desc: "Rebase to Alpine 3.18, deprecate armhf."}
- {date: "04.02.23:", desc: "Minor updates to defaults in custom.cnf."}
- {date: "31.01.23:", desc: "Rebase to 3.17."}
- {date: "09.12.22:", desc: "Add upgrade check warning."}
- {date: "11.10.22:", desc: "Rebase master to Alpine 3.16, migrate to s6v3, remove password escape logic which caused problems for a small subset of users."}
- {date: "06.07.21:", desc: "Rebase master to alpine."}
- {date: "03.07.21:", desc: "Rebase to 3.14."}
- {date: "08.02.21:", desc: "Fix new installs."}
- {date: "08.02.21:", desc: "Rebase to alpine. Add mariadb-backup."}
- {date: "08.02.21:", desc: "Release alpine tag. The alpine release will replace the latest tag in the near future."}
- {date: "27.10.19:", desc: "Bump to 10.4, ability use custom sql on initial init ,defining root passwords via file."}
- {date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag."}
- {date: "07.03.19:", desc: "Add ability to setup a database and default user on first spinup."}
- {date: "26.01.19:", desc: "Add pipeline logic and multi arch."}
- {date: "10.09.18:", desc: "Rebase to ubuntu bionic and use 10.3 MariaDB repository."}
- {date: "09.12.17:", desc: "Fix continuation lines."}
- {date: "12.09.17:", desc: "Gracefully shut down MariaDB."}
- {date: "27.10.16:", desc: "Implement linting suggestions on database init script."}
- {date: "11.10.16:", desc: "Rebase to ubuntu xenial, add version labelling."}
- {date: "09.03.16:", desc: "Update to MariaDB 10.1. Change to use custom.cnf over my.cnf in /config. Restructured init files to change config options on startup, rather than in the dockerfile."}
- {date: "26.01.16:", desc: "Change user of mysqld_safe script to abc, better unclean shutdown handling on restart."}
- {date: "23.12.15:", desc: "Remove autoupdating, between some version updates the container breaks."}
- {date: "12.08.15:", desc: "Initial Release."}