diff --git a/command.sh b/command.sh index bcf1d8b..46c3504 100644 --- a/command.sh +++ b/command.sh @@ -52,7 +52,17 @@ cd ${CI_WORKSPACE} # Ensure that secrets (passed through as env vars) are available. Iterate and purposefully omit newlines. for k in $(compgen -e); do - echo $k=${!k} >> ${PWD}/outer_env_vars.env + touch ${PWD}/outer_env_vars.env + case "$k" in + # avoid overwriting container's variables + # Note that the env vars to blacklist may be found using + # `docker run -it --entrypoint env quay.io/testcontainers/dind-drone-plugin` + DIND_COMMIT|DOCKER_CHANNEL|DOCKER_TLS_CERTDIR|DOCKER_VERSION|HOME|HOSTNAME|PATH|PWD|SHLVL) + ;; + *) + echo $k=${!k} >> ${PWD}/outer_env_vars.env + ;; + esac done # Determine IP address at which dockerd and spawned containers can be reached @@ -92,4 +102,4 @@ run_hook_scripts post_run rm outer_env_vars.env -exit $CMD_EXIT_CODE \ No newline at end of file +exit $CMD_EXIT_CODE