Is it possible to get the file of the layers of the official DHIS2 Docker image

I am experimenting with deploying DHIS2 in docker dev and production environment.

I want to manually build the DHIS2 image. Is it possible to get the file of the layers of the official DHIS2 Docker image?

I hope this answers you question, there are instructions on how to build the DHIS2 image on the core repository dhis2-core/README.md at master · dhis2/dhis2-core · GitHub

After your have the image running in your local system, use the docker history command which will help see the commands.

If it doesn’t please answer your question, please explain more. Thanks!

Thanks for the response. I have explore the reference about the build process above before. But the only concrete info there is To build it you must first install the root POM file, navigate to the dhis-web directory and then build the web POM file.

This instruction doesn’t address my question. I wanted to find out if I can get the build steps used for the latest version 2.40.0.1

Like the steps in a Dockerfile. Or since they use jib, the step by step build process to build the dhis2/core-dev image so that I can manipulate it to build the production image. The process was clearer in v2.36.x.x but now the documentation is lacking.

Hi @jetisco4u :smile:

https://github.com/dhis2/dhis2-core/blob/master/README.md#docker-image describes how you can build the Docker image. We switched to using https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin to build our Docker images. This means there is no Dockerfile.

Please let me know if you have any other question :smile:

1 Like

Sure I know jib don’t use Dockerfile. I currently use the old build approach that stop with 2.36.x.x version on the latest 2.40.0.1 version. In other word this include a Dockerfile with the jib build. The way I build my container locally, I don’t install Maven and Java on my machine. I install them as utility container and use them to build the image. Under the hood it’s similar to what jib is doing. I fill maybe I am duplicating the install process for dhis-2/pom.xml and dhis-2/dhis-web/pom.xml. So I want to find a way to implement the current jib build approach into my multi build image container while preserving the utility approach. I may have to remove the jib build if need be then.

I am trying to figure out if the instruction under Build process is different from the one for Docker image under it.

The Build process instruction says To build it you must first install the root POM file, navigate to the dhis-web directory and then build the web POM file.

Then under the Docker image the instruction says The DHIS2 Docker image is built using Jib. To build make sure to build DHIS2 and the web project first

./dhis-2/build-dev.sh

I want to find out if this instruction is the same and mean that I should build or install the root POM file, navigate to the dhis-web directory and then build the web POM file whichever way I deem fit.

Better still does it mean before I can run ./dhis-2/build-dev.sh to build the docker image I need to install the root POM file, navigate to the dhis-web directory and then install the web POM file.

I don’t know what it is that you actually want to achieve yet :smile: What is it that your container image should have/do differently than what the current container image is doing?

You have 2 choices IMHO

  1. adapt our jib build to your needs (hence the question about your goal above)
  2. or use Docker with a Dockerfile without using jib

For 2. and maybe for your general understanding

Executing

will build the war file. The target is printed like

Building war: $HOME/dhis2/core/dhis-2/dhis-web/dhis-web-portal/target/dhis.war

Which is likely what you want to put in Tomcat or the like.

1 Like

According to the doc, the DHIS2 image is not optimize for production. I am trying to deploy for production preferably with ECS.

Thank you. I am able to do option 2 successfully. I will explore option 1.

Great that you have a working solution :smile:

That is not exactly what we are saying :smile:

https://hub.docker.com/r/dhis2/core

We cannot recommend the images for use in production. At this point we don’t have enough experience and therefore can’t vouch for their stability for “mission critical” production use. We are not saying that someone experienced with running Docker in production shouldn’t use them. In other words, anyone deciding to use DHIS2 in Docker should be aware that they are doing so at their own risk. If you decide to go for it, make sure you perform enough security, performance and stress testing.

Rather that you would need to do your own testing on these images to ensure they are production ready.

1 Like

Oh ok I understand that the official deployed image is not optimized for production which is obvious. Anyway I already deploy my custom build image using the old build approach with war.