diff --git a/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh b/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh index 8ffade9..3c2b463 100755 --- a/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh +++ b/rootfs/usr/local/etc/docker/init.d/05-dockerd.sh @@ -263,8 +263,11 @@ __run_precopy() { # Define environment local hostname=${HOSTNAME} [ -d "/run/healthcheck" ] || mkdir -p "/run/healthcheck" - # Define actions/commands - + # Seed /config/$SERVICE_NAME from the baked /etc copy on first run + if [ -d "$ETC_DIR" ] && __is_dir_empty "$CONF_DIR"; then + mkdir -p "$CONF_DIR" + cp -Rf "$ETC_DIR/." "$CONF_DIR/" 2>/dev/null || true + fi # allow custom functions if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi } @@ -940,9 +943,6 @@ sysname="${SERVER_NAME:-${FULL_DOMAIN_NAME:-$HOSTNAME}}" # - - - - - - - - - - - - - - - - - - - - - - - - - __create_service_env # - - - - - - - - - - - - - - - - - - - - - - - - - -# Setup /config directories -__init_config_etc -# - - - - - - - - - - - - - - - - - - - - - - - - - # pre-run function __execute_prerun # - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh index 883af7b..0ee6ee2 100755 --- a/rootfs/usr/local/etc/docker/init.d/08-gitea.sh +++ b/rootfs/usr/local/etc/docker/init.d/08-gitea.sh @@ -291,6 +291,11 @@ __run_precopy() { # during container startup, after the entrypoint's initial copy. Applying it here # (in the init.d phase) ensures it takes effect after Docker finishes network setup. [ -f "/usr/local/etc/resolv.conf" ] && cp -f "/usr/local/etc/resolv.conf" "/etc/resolv.conf" 2>/dev/null || true + # Seed /config/$SERVICE_NAME from the baked /etc copy on first run + if [ -d "$ETC_DIR" ] && __is_dir_empty "$CONF_DIR"; then + mkdir -p "$CONF_DIR" + cp -Rf "$ETC_DIR/." "$CONF_DIR/" 2>/dev/null || true + fi # allow custom functions if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi } @@ -870,9 +875,6 @@ sysname="${SERVER_NAME:-${FULL_DOMAIN_NAME:-$HOSTNAME}}" # - - - - - - - - - - - - - - - - - - - - - - - - - __create_service_env # - - - - - - - - - - - - - - - - - - - - - - - - - -# Setup /config directories -__init_config_etc -# - - - - - - - - - - - - - - - - - - - - - - - - - # pre-run function __execute_prerun # - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh index eb80db1..6911676 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh @@ -333,8 +333,11 @@ __run_precopy() { # Define environment local hostname=${HOSTNAME} [ -d "/run/healthcheck" ] || mkdir -p "/run/healthcheck" - # Define actions/commands - + # Seed /config/$SERVICE_NAME from the baked /etc copy on first run + if [ -d "$ETC_DIR" ] && __is_dir_empty "$CONF_DIR"; then + mkdir -p "$CONF_DIR" + cp -Rf "$ETC_DIR/." "$CONF_DIR/" 2>/dev/null || true + fi # allow custom functions if builtin type -t __run_precopy_local | grep -q 'function'; then __run_precopy_local; fi } @@ -916,9 +919,6 @@ sysname="${SERVER_NAME:-${FULL_DOMAIN_NAME:-$HOSTNAME}}" # - - - - - - - - - - - - - - - - - - - - - - - - - __create_service_env # - - - - - - - - - - - - - - - - - - - - - - - - - -# Setup /config directories -__init_config_etc -# - - - - - - - - - - - - - - - - - - - - - - - - - # pre-run function __execute_prerun # - - - - - - - - - - - - - - - - - - - - - - - - -