Steps to Reproduce: 1. Verify database user and password: ``` psql --host 127.0.0.1 --port 5432 --username postgres_exporter postgres Password for user postgres_exporter: psql (9.5.7) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off) Type "help" for help. postgres=> ``` 2. Docker run with: ``` docker run -e DATA_SOURCE_NAME="postgresql://postgres_exporter:password@127.0.0.1:5432/postgres?sslmode=disable" -p 9187:9187 wrouesnel/postgres_exporter ``` 3. Result: ``` level=info msg="Error opening connection to database (could not parse DATA_SOURCE_NAME): dial tcp 127.0.0.1:5432: getsockopt: connection refused" source="postgres_exporter.go:959" ```