Server not connecting docker during OpenMrs installation

Hi good people, I hope all is well. I am installing OpenMRS for two days now! Challenge is whenever I reach the step of the server connecting to docker, it fails. I seek your guidance on how to go around that. I have attached a screenshot to better explain what I am facing. Thanks a lot

Oh sorry! have you already installed a docker container?

Could you try running mvn openmrs-sdk:setup -DdockerHost=tcp://127.0.0.1:2376?

An alternative solution is to do the steps described here to ensure that Docker on your Windows machine can use port 2375.

A third option is just to use the command line to create an appropriate MySQL container in Docker and tell the SDK you’re just using an installed MySQL server. The default MySQL version created by the SDK can be setup like this (note that this runs on port 3308):

docker run --name openmrs-sdk-mysql-v3-2 -e MYSQL_ROOT_PASSWORD=Admin123 -e MYSQL_USER=openmrs -e MYSQL_PASSWORD=Admin123 -p 3308:3306 --restart unless-stopped -d mysql:5.6 --character-set-server=utf8 --collation-server=utf8_unicode_ci

Or, to use the standard MySQL port (this might be easier in some instances):

docker run --name openmrs-sdk-mysql-v3-2 -e MYSQL_ROOT_PASSWORD=Admin123 -e MYSQL_USER=openmrs -e MYSQL_PASSWORD=Admin123 -p 3306:3306 --restart unless-stopped -d mysql:5.6 --character-set-server=utf8 --collation-server=utf8_unicode_ci

Or to use MySQL 8 (assuming that you’re only working with platform 2.4+):

docker run --name openmrs-sdk-mysql-v3-2 -e MYSQL_ROOT_PASSWORD=Admin123 -e MYSQL_USER=openmrs -e MYSQL_PASSWORD=Admin123 -p 3308:3306 --restart unless-stopped -d mysql:8 --character-set-server=utf8 --collation-server=utf8_unicode_ci

alternatively,you can install openmrs with mysql db using the sdk OpenMRS SDK Step By Step Tutorials - Documentation - OpenMRS Wiki

@herbert24 I assume that @seremba has already seen that. This is an error that’s raised in the context of following the steps there and not addressed in that Wiki page.

2 Likes

ohh ok @ibacher

No I have not yet installed one but I have docker though

Thank you @ibacher. Going to follow these steps and see how everything works out finally

The third option helped me created an MYSQL container in docker. But on running locally at port 3308 I get something like in the screenshot below!

That’s actually expected. So with the Docker command above, you exposed the MySQL service on port 3308. The MySQL service understands it’s own binary protocol and doesn’t return a response your browser can understand. You can check that it’s working with any tool capable of talking to MySQL or you can just continue with the SDK setup, which will also try to talk to the MySQL container and tell you if there are any errors.

1 Like

@herbert24 @ibacher @jwnasambu I need your help more! I have not been successful yet with installing openmrs. Followed the steps above and more on other threads but I can’t understand why it is failing. I am starting to think maybe the problem is with my machine! Everything is okay, until the step of connecting to the server!

The db docker container support comes in the following forms:

  1. Letting SDK create and manage a MySQL 5.7 docker container for you.
  2. Creating a DB docker container manually and specifying container Id, label or name and connection details when setting up a server. Basing on the error reflected on the screenshot shared above you are using the later (though not sure kindly forgive me) and the error you are getting is likely caused by the db docker container not running.
1 Like

@seremba could this be of help Installing OpenMRS on Docker - Documentation - OpenMRS Wiki

1 Like

Thank you, Juliet! for the kind response!

i can pickup some time on weekend on call to help you get unblocked

Thank you, buddy! That is so nice of you

i can make sunday 11am

thanks, friend! I was have just seen this message. Docker failed and I used other options with the help of Nsereko

1 Like

Hi all, I am currently having the same issue as @seremba stated. Server is still not connecting to Docker. I have tried the options as stated by @ibacher but error persists. kindly assist me.

Thanks