DHIS2 starts support of official docker images

Hi docker fans,

DHIS2 core team starts support of official docker images! image
You can find docker repositories under dhis2 organisation in Docker Hub. All the latest stable releases will be placed under the core repository. Users who want to peek into latest development efforts might also find core-dev repository interesting.

Usage

Run the built image using configuration from ~/dhis2_home (mounted read-only):

docker run -d --rm -p 8080:80 -v $pathToLocalHomeDir:/DHIS2_home:ro dhis2/core:2.32.0

Note that a connection to a running Postgres database must be configured in your ~/dhis2_home/dhis.conf.

For more information, read DHIS2 with Docker guide.

We would love to hear from you: what is your experience dockerizing DHIS2 instances? How can we make docker images even better?

15 Likes

Hi @Gintare,

I think the links you gave are only accessible to the dhis2 user in Docker.

Did you mean to give the public Docker Hub links? As in these:
https://hub.docker.com/r/dhis2/core
https://hub.docker.com/r/dhis2/core-dev

We’ve been running all our DHIS2 servers in Docker for the last 3 years or so at eHealth Africa quite happily with no issues. It makes handling deployments quite easy.

Cheers,

  • Jasper
3 Likes

Hi Jasper,

Thanks for correcting, I updated the links! :slight_smile:
I am glad you have had success with docker and DHIS2. Have you created custom images for it? If so, we would be glad to get your input on what is missing to make our images production-friendly.

/ Gintare

2 Likes

Congrats!
Any tutorials on how to migrate to docker images?

3 Likes

Hi @Gintare,

Our Dockerfile is fairly barebones, essentially just starting from the tomcat7 base image and running the DHIS2 war file (with some other small config changes).

Is the Dockerfile used for the above Docker Hub image made public somewhere?

Also, what war file is used for the image? i.e. are the Jenkins CI build war files used as soon as they’re available?

Thanks,

  • Jasper
3 Likes

That’s great news. We are also using docker for our dhis2 implementation since last year. This is very helpful particularly for decentralized implementation. We are deploying server (NUC) with NixOS in the field and remotely (ssh) maintain the host and local dhis2 instance. We are using the data and metadata sync from field instance to the central instance. There were some challenges using docker specially with jvm memory. So far we have implemented dhis2 in 5 countries using docker.

5 Likes

Hi!

@Jasper_Timm,

Yes, dockerfile is available same as the rest of the code. You can find it here. You can see that docker build is multi-staged. We build WAR file in first stage and use that in the images we publish. Jenkins builds images every 20 minutes if any changes were made for versions starting from 2.30.

@Mohammad_Ullah,

Thanks for sharing, great to hear about your positive experience dockerising DHIS2 instance! If you get to try our images, please do not hesitate to give feedback or request features :slight_smile:

2 Likes

This is great news, however just wanted to find out from @Gintare and team if there are any plans to add some documentation in the implementations guide on setting up DHIS2 using docker?

3 Likes

Hi @haroon,

That’s a great suggestion! Right now we can’t recommend using our images in production as we still want to make few security improvements and hear from implementations who use docker successfully. When we make images ‘production-ready’, we will consider adding a section to the implementation guide. However, we will definitely add a guide to using our images to at least our docker-hub page soon. :slight_smile:

3 Likes

Beautiful :ok_hand:!! Love the progressive mentality, aligning DHIS2 with powerful emerging technologies. Keep us posted please :slightly_smiling_face:

4 Likes

So happy to hear DHIS2 is supporting Docker. I’m struggling to get DHIS2 up and operational for an NGO. Like @SDKAAA, I’m also wondering if there is any tutorials or plans to add documentation in the implementation guide as suggested by @haroon.

3 Likes

the implementer guide is enough for you to implement DHIS2… if you follow the instructions properly and have the right server specifications everything should work fine.

3 Likes

Hi @gjlisiak

As Gintare said, we will try to provide some guidance for Docker images at some point in the near future. At the moment we are preparing for the 2.33 release and so are a bit swamped with other priorities.

We will keep you all posted!

Kind regards,
Phil

2 Likes

Thanks Philip we appreciate the great work.

1 Like

Hi @haroon, @gjlisiak and others.

As per your request, I wrote a small guide about how to use our docker images. You can find it here. I will edit my original post to include it as well.

Happy dockering!

5 Likes

Thank you

1 Like

Hello Everyone, This is my first time to post here and I had been reading a lot of great topics around the community concerning DHIS2 installation, deployment etc. and with that, In behalf of NCP, I just like to share this simple dockerized DHIS2 (web and core versions) https://ncp-ph.github.io/ec2dhis2docker/

3 Likes

Hello @dhec, So glad to have you here. Thank you for sharing this.

1 Like

Hi @dhec,

Thanks for sharing, your setup looks great! I had a quick look and I see that in your docker-compose.yml you use the old images, from dhis2/dhis2-web repository. This image repository is not maintained by DHIS2 core team and we can’t guarantee that it always has the latest version of DHIS2 and is working properly. I would recommend you to try the other repositories not marked as [Not maintained by DHIS2 team].

2 Likes

Thanks @Gintare,

Yeah, I just noticed today that there’s now a note on DHIS2 dockerhub that says it’s not a supported version, though I’ve included the supported DHIS2-core version (dhis2-core.yml) on the repository, I think I’ll set the Core version as default on docker-compose.yml moving forward and will try to test and put other supported docker images as well. We’ll keep you all posted.

2 Likes