-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from Automattic/add-mariadb-ep-support
feat(mariadb): add support for entrypoints
- Loading branch information
Showing
10 changed files
with
141 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
{ | ||
"name": "MariaDB", | ||
"id": "mariadb", | ||
"version": "1.1.5", | ||
"version": "1.2.0", | ||
"description": "Sets up MariaDB into the Dev Environment", | ||
"options": { | ||
"installDatabaseToWorkspaces": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "Set MariaDB data directory to /workspaces/mysql-data to persist data between container rebuilds (GHCS)" | ||
}, | ||
"install-runit-service": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Whether to install a runit service for Mailpit" | ||
} | ||
}, | ||
"installsAfter": [ | ||
"ghcr.io/automattic/vip-codespaces/base" | ||
"ghcr.io/automattic/vip-codespaces/entrypoints" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
exec 2>&1 | ||
|
||
export LD_PRELOAD= | ||
|
||
# shellcheck disable=SC2154 | ||
install -d -D -m 02755 -o "${MARIADB_USER}" -g "${MARIADB_USER}" "${MARIADB_DATADIR}" | ||
chown -R "${MARIADB_USER}:${MARIADB_USER}" "${MARIADB_DATADIR}" | ||
|
||
install -d /run/mysqld -o "${MARIADB_USER}" -g "${MARIADB_USER}" | ||
|
||
if [ ! -d "${MARIADB_DATADIR}/mysql" ]; then | ||
mysql_install_db --auth-root-authentication-method=normal --skip-test-db --user="${MARIADB_USER}" --datadir="${MARIADB_DATADIR}" | ||
fi | ||
|
||
if [ -x /sbin/chpst ]; then | ||
exec chpst -u "${MARIADB_USER}:${MARIADB_USER}" \ | ||
mysqld \ | ||
--datadir="${MARIADB_DATADIR}" \ | ||
--sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION \ | ||
--max_allowed_packet=67M \ | ||
--skip_networking=0 \ | ||
--bind-address=127.0.0.1 & | ||
else | ||
exec su-exec "${MARIADB_USER}:${MARIADB_USER}" \ | ||
mysqld \ | ||
--datadir="${MARIADB_DATADIR}" \ | ||
--sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION \ | ||
--max_allowed_packet=67M \ | ||
--skip_networking=0 \ | ||
--bind-address=127.0.0.1 & | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
exec 2>&1 | ||
|
||
export LD_PRELOAD= | ||
|
||
# shellcheck disable=SC2154 | ||
install -d -D -m 02755 -o "${MARIADB_USER}" -g "${MARIADB_USER}" "${MARIADB_DATADIR}" | ||
chown -R "${MARIADB_USER}:${MARIADB_USER}" "${MARIADB_DATADIR}" | ||
|
||
install -d /run/mysqld -o "${MARIADB_USER}" -g "${MARIADB_USER}" | ||
|
||
if [ ! -d "${MARIADB_DATADIR}/mysql" ]; then | ||
mysql_install_db --auth-root-authentication-method=normal --skip-test-db --user="${MARIADB_USER}" --datadir="${MARIADB_DATADIR}" | ||
fi | ||
|
||
MY_UID="$(id -u "${MARIADB_USER}")" | ||
MY_GID="$(id -g "${MARIADB_USER}")" | ||
|
||
exec setpriv --reuid="${MY_UID}" --regid="${MY_GID}" --inh-caps=-all --init-groups \ | ||
mysqld \ | ||
--datadir="${MARIADB_DATADIR}" \ | ||
--sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION \ | ||
--max_allowed_packet=67M \ | ||
--skip_networking=0 \ | ||
--bind-address=127.0.0.1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alpine-normal-nopersist.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alpine-normal-nopersist.sh |