From dfa565247e6319b5414044c880dd6fecdd1f721a Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Fri, 28 Apr 2023 11:23:30 +0200 Subject: [PATCH 1/2] Slightly simplify the wait directive --- entrypoint.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 676d0e8..a8dc40b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -431,9 +431,7 @@ COMMAND=( [[ -n "${LAUNCH_ARG_ENVFILE}" ]] && COMMAND=(--env-file "${LAUNCH_ARG_ENVFILE}" "${COMMAND[@]}") # Here is the container started -docker compose "${COMMAND[@]}" & +docker compose "${COMMAND[@]}" & wait $! -child=$! -wait "$child" _cleanup From 02dc66fa70bee57230dc2dcbcfce9525d1dd3ac5 Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Fri, 28 Apr 2023 11:35:53 +0200 Subject: [PATCH 2/2] #32: Fix `LAUNCH_EXT_NETWORKS_MIXED` and `LAUNCH_EXT_NETWORKS_IPV6` --- entrypoint.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index a8dc40b..5257873 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -336,15 +336,14 @@ xEOF if [ -n "${LAUNCH_EXT_NETWORKS_IPV6}" ]; then read -ra ARR <<<"${LAUNCH_EXT_NETWORKS_IPV6}" for NETWORK in "${ARR[@]}"; do - IFS=':' read -r NETWORK IPV6 <<< "${NETWORK}" + IFS='-' read -r NETWORK IPV6 <<< "${NETWORK}" { echo " ${NETWORK}:" echo " ipv6_address: '${IPV6}'" } >> "${COMPOSE_FILE}" done fi - # LAUNCH_EXT_NETWORKS_MIXED are existing attachable networks, where the IP is manually assigned - # This assumes both IPv4 and IPv6 addresses are manually assigned + # LAUNCH_EXT_NETWORKS_MIXED are existing attachable networks, where the IPV4 and IPV6 is manually assigned # The format is `network1-ipv4-ipv6 network2-ipv4-ipv6 ... networkN-ipv4-ipv6` if [ -n "${LAUNCH_EXT_NETWORKS_MIXED}" ]; then read -ra ARR <<<"${LAUNCH_EXT_NETWORKS_MIXED}" @@ -357,6 +356,7 @@ xEOF } >> "${COMPOSE_FILE}" done fi + # Here starts the `networks` section echo "networks:" >> "${COMPOSE_FILE}" for NETWORK in ${LAUNCH_NETWORKS}; do { @@ -381,6 +381,26 @@ xEOF } >> "${COMPOSE_FILE}" done fi + if [ -n "${LAUNCH_EXT_NETWORKS_IPV6}" ]; then + read -ra ARR <<<"${LAUNCH_EXT_NETWORKS_IPV6}" + for NETWORK in "${ARR[@]}"; do + IFS='-' read -r NETWORK IPV6 <<< "${NETWORK}" + { + echo " ${NETWORK}:"; + echo " external: true"; + } >> "${COMPOSE_FILE}" + done + fi + if [ -n "${LAUNCH_EXT_NETWORKS_MIXED}" ]; then + read -ra ARR <<<"${LAUNCH_EXT_NETWORKS_MIXED}" + for NETWORK in "${ARR[@]}"; do + IFS='-' read -r NETWORK IPV4 IPV6 <<< "${NETWORK}" + { + echo " ${NETWORK}:"; + echo " external: true"; + } >> "${COMPOSE_FILE}" + done + fi fi fi fi