retrievercommunications / docker-jasperserver

Docker image for the community edition of JasperReports® Server.
https://hub.docker.com/r/retriever/jasperserver/
MIT License
46 stars 50 forks source link

Container ignores port specified in env for database connection MySQL #34

Closed andrewyang-retriever closed 5 years ago

andrewyang-retriever commented 5 years ago

It seems like even though you supply env ${DB_PORT}, when it actually starts up it still tries to use 3306 (I tried setting DB_PORT to 3307).

,2019-08-01T01:21:21.805777100Z /usr/src/jasperreports-server/buildomatic/bin/app-server.xml:58: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=localhost)(port=3306)(type=master) : Connection refused (Connection refused)
,2019-08-01T01:21:21.805771200Z BUILD FAILED
,2019-08-01T01:21:21.805774300Z /usr/src/jasperreports-server/buildomatic/bin/db-common.xml:45: The following error occurred while executing this line:
grange74 commented 5 years ago

Can you please specify exactly how you are running it? command line/docker compose? can you supply?

andrewyang-retriever commented 5 years ago

Sure, this is the command I run: docker run -d --name jasperserver -e DB_TYPE=mysql -e DB_HOST=localhost -e DB_PORT=3307 -e DB_USER=root -e DB_PASSWORD=root -p 8079:8080 retriever/jasperserver

Maybe it's due to removing the --link comand? --link jasperserver_mysql:db although not sure how that changes the port number

andrewyang-retriever commented 5 years ago

Hmm I can't seem to reproduce the exact same issue anymore lol

All I can add is that instead of using the link or any network bridge, I attempted to connect to a db-container which was also bound to my host's 3307 port (but internally the db ran on 3306 within its own container).

Closing issue as it's practically useless without being able to reproduce it now :P