17 lines
426 B
SYSTEMD
17 lines
426 B
SYSTEMD
|
[Unit]
|
||
|
Description=Mariadb Container
|
||
|
After=docker.service
|
||
|
Requires=docker.service
|
||
|
|
||
|
[Service]
|
||
|
TimeoutStartSec=0
|
||
|
Restart=always
|
||
|
ExecStartPre=-/usr/bin/docker stop %n
|
||
|
ExecStartPre=-/usr/bin/docker rm %n
|
||
|
ExecStartPre=/usr/bin/docker pull mariadb:10.1.22
|
||
|
ExecStart=/usr/bin/docker run -p 3306:3306 --name %n -v /srv/lib/mysql:/var/lib/mysql \
|
||
|
-e MYSQL_ROOT_PASSWORD=geheim mariadb:10.1.22
|
||
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|