I\'m new to Docker, and it\'s unclear how to access an external database from a container. Is the best way to hard-code in the connection string?
# Dockerfil
Using jq to convert the env to JSON:
env_as_json=`jq -c -n env` docker run -e HOST_ENV="$env_as_json"
this requires jq version 1.6 or newer
this pust the host env as json, essentially like so in Dockerfile:
ENV HOST_ENV (all env from the host as json)