From 7d611fc32a86471ab8ee07c61bbb94e29e23b1e3 Mon Sep 17 00:00:00 2001 From: Merith Date: Tue, 1 Oct 2024 13:28:51 -0700 Subject: [PATCH] work around env file not loaded --- entrypoint.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 82119a6..68cc3d2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -58,8 +58,10 @@ if [[ ! -f "${CONFIG_FILE}" ]]; then if [[ "${DOCKER_PRIVILEGED}" == "true" ]]; then sed -i "/^ privileged:/c\ privileged: true" ${CONFIG_FILE} - sed -i "/^ options:/c\ options: -v /certs/client:/certs/client" ${CONFIG_FILE} + sed -i "/^ options:/c\ options: -v /certs/client:/certs/client:ro" ${CONFIG_FILE} sed -i "/^ valid_volumes:/c\ valid_volumes:\n - /certs/client" ${CONFIG_FILE} + + sed -i "/^ envs:/c\ envs:\n DOCKER_HOST: ${DOCKER_HOST}\n DOCKER_TLS_VERIFY: ${DOCKER_TLS_VERIFY}\n DOCKER_CERT_PATH: ${DOCKER_CERT_PATH}" ${CONFIG_FILE} fi fi @@ -68,14 +70,6 @@ ENV_FILE=${ENV_FILE:-"/data/.env"} decho "ENV_FILE: ${ENV_FILE}" sed -i "/^ env_file:/c\ env_file: ${ENV_FILE}" ${CONFIG_FILE} -if [[ ! -f "${ENV_FILE}" ]]; then - echo "Creating ${ENV_FILE}" - touch ${ENV_FILE} - echo "DOCKER_HOST=${DOCKER_HOST}" >> ${ENV_FILE} - echo "DOCKER_TLS_VERIFY=${DOCKER_TLS_VERIFY}" >> ${ENV_FILE} - echo "DOCKER_CERT_PATH=${DOCKER_CERT_PATH}" >> ${ENV_FILE} -fi - EXTRA_ARGS="" if [[ ! -z "${RUNNER_LABELS}" ]]; then EXTRA_ARGS="${EXTRA_ARGS} --labels ${RUNNER_LABELS}"