-
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 #238 from Automattic/add-entrypoints-feature
feat: add `entrypoints` feature
- Loading branch information
Showing
5 changed files
with
35 additions
and
0 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 |
---|---|---|
|
@@ -32,6 +32,7 @@ jobs: | |
- cron | ||
- dev-tools | ||
- elasticsearch | ||
- entrypoints | ||
- php | ||
- mailpit | ||
- mariadb | ||
|
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,7 @@ | ||
{ | ||
"id": "entrypoints", | ||
"name": "Entrypoint Runner", | ||
"description": "Runs entrypoint scripts for images without runit", | ||
"version": "1.0.0", | ||
"entrypoint": "/usr/local/bin/entrypoint-runner" | ||
} |
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,9 @@ | ||
#!/bin/sh | ||
|
||
PATH=/bin:/sbin:/usr/bin:/usr/sbin | ||
|
||
if [ -x /usr/local/bin/runit-wrapper ] || [ -x /lib/runit/runit-init ] || [ ! -d /var/lib/entrypoint.d ]; then | ||
exit 0 | ||
fi | ||
|
||
exec run-parts /var/lib/entrypoint.d |
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,11 @@ | ||
#!/bin/sh | ||
|
||
PATH=/bin:/sbin:/usr/bin:/usr/sbin | ||
|
||
if [ "$(id -u || true)" -ne 0 ]; then | ||
echo 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' | ||
exit 1 | ||
fi | ||
|
||
install -D -d -m 0755 -o root -g root /var/lib/entrypoint.d | ||
install -m 0755 -o root -g root entrypoint-runner /usr/local/bin/entrypoint-runner |
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,7 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck source=/dev/null | ||
source dev-container-features-test-lib | ||
|
||
check "/var/lib/entrypoint.d exists" test -d /var/lib/entrypoint.d | ||
check "/usr/local/bin/entrypoint-runner exists and is executable" test -x /usr/local/bin/entrypoint-runner |