Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 964e862

Browse files
authored
create env INIT_SCRIPTS_PATH to specify path for init files in Docker (#3052)
1 parent 3a1a076 commit 964e862

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ You can pass the following environment variables to LocalStack:
217217
* `EXTRA_CORS_EXPOSE_HEADERS`: Comma-separated list of header names to be be added to `Access-Control-Expose-Headers` CORS header
218218
* `LAMBDA_JAVA_OPTS`: Allow passing custom JVM options (e.g., `-Xmx512M`) to Java Lambdas executed in Docker. Use `_debug_port_` placeholder to configure the debug port (e.g., `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=_debug_port_`).
219219
* `MAIN_CONTAINER_NAME`: Specify the main docker container name (default: `localstack_main`).
220+
* `INIT_SCRIPTS_PATH`: Specify the path to the initializing files with extensions .sh that are found default in `/docker-entrypoint-initaws.d`.
220221

221222
The following environment configurations are *deprecated*:
222223
* `USE_SSL`: Whether to use `https://...` URLs with SSL encryption (default: `false`). Deprecated as of version 0.11.3 - each service endpoint now supports multiplexing HTTP/HTTPS traffic over the same port.
@@ -251,7 +252,7 @@ The service `/health` check endpoint on the edge port (`http://localhost:4566/he
251252

252253
### Initializing a fresh instance
253254

254-
When a container is started for the first time, it will execute files with extensions .sh that are found in `/docker-entrypoint-initaws.d`. Files will be executed in alphabetical order. You can easily create aws resources on localstack using `awslocal` (or `aws`) cli tool in the initialization scripts.
255+
When a container is started for the first time, it will execute files with extensions .sh that are found in `/docker-entrypoint-initaws.d` or an alternate path defined in `INIT_SCRIPTS_PATH`. Files will be executed in alphabetical order. You can easily create aws resources on localstack using `awslocal` (or `aws`) cli tool in the initialization scripts.
255256

256257
## Using custom SSL certificates
257258

‎bin/docker-entrypoint.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
set -eo pipefail
44
shopt -s nullglob
55

6+
if [[ ! $INIT_SCRIPTS_PATH ]]
7+
then
8+
INIT_SCRIPTS_PATH=/docker-entrypoint-initaws.d
9+
fi
10+
611
# Strip `LOCALSTACK_` prefix in environment variables name (except LOCALSTACK_HOSTNAME)
712
source <(
813
env |
@@ -22,7 +27,7 @@ function run_startup_scripts {
2227
sleep 7
2328
done
2429

25-
for f in /docker-entrypoint-initaws.d/*; do
30+
for f in $INIT_SCRIPTS_PATH/*; do
2631
case "$f" in
2732
*.sh) echo "$0: running $f"; . "$f" ;;
2833
*) echo "$0: ignoring $f" ;;

0 commit comments

Comments
 (0)