Building dhis2/core:2.37.4-tomcat-8.5.34-jre8-alpine Image on PPC64LE

facing errors to build dhis2/core image on power architecture. need assistance with image-building steps and base image support.

Hi @Shreya_Kajbaje

Welcome to the community. Would you share the kind of errors that you are facing?

You can either follow the guideline in the github repository: GitHub - dhis2/dhis2-core: DHIS 2 Core. Written in Java. Contains the service layer and Web API.

Or if you want an easier guideline which is not for production purposes, check out: How to spin up a DHIS2 local instance | DHIS2 Developer Portal

Thank you!

Hi @Gassim thanks for your reply. I’m trying to build v2.37.4 dhirs2-core/docker/tomcat-alpine/Dockerfile. can you please confirm this dockerfile requires tomcat:9.0-jre17 base image? error logs -

Step 7/15 : RUN rm -rf /usr/local/tomcat/webapps/* && mkdir /usr/local/tomcat/webapps/ROOT && mkdir $DHIS2_HOME && addgroup -S tomcat && addgroup root tomcat && adduser -S -D -G tomcat tomcat && echo ‘tomcat’ >> /etc/cron.deny && echo ‘tomcat’ >> /etc/at.deny
—> Running in db5594e5b51b
Option s is ambiguous (shell, system)
adduser [–home DIR] [–shell SHELL] [–no-create-home] [–uid ID]
[–firstuid ID] [–lastuid ID] [–gecos GECOS] [–ingroup GROUP | --gid ID]
[–disabled-password] [–disabled-login] [–add_extra_groups]
[–encrypt-home] USER
Add a normal user

adduser --system [–home DIR] [–shell SHELL] [–no-create-home] [–uid ID]
[–gecos GECOS] [–group | --ingroup GROUP | --gid ID] [–disabled-password]
[–disabled-login] [–add_extra_groups] USER
Add a system user

adduser --group [–gid ID] GROUP
addgroup [–gid ID] GROUP
Add a user group

addgroup --system [–gid ID] GROUP
Add a system group

adduser USER GROUP
Add an existing user to an existing group

Hi @Gassim can you please share some pointers that will help. thanks

Hello @Shreya_Kajbaje

The base image we’ve used for building our own 2.37.4 Docker image tags is definitely not tomcat:9.0-jre17.

I’m not entirely sure if that DHIS2 version would completely work on Java 17.

We have images for the 2.37.4 tag built with tomcat versions 8.0, 8.5 and 9.0, with variations of both Java 8 and Java 11, but since the question seems to be an “alpine” image, theres only one image we have available - 2.37.4-tomcat-8.5.34-jre8-alpine.

Now, since you want to build an image on ppc64le (GitHub - docker-library/official-images: Primary source of truth for the Docker "Official Images" program) - you would have to do it yourself, as we don’t really support that architecture (and nor does Docker “officially”, according to the previous link).

We can, of course, help with some troubleshooting, but the error you’ve provided is not enough to figure out what might be wrong. It seems to be a problem with the -S option for either adduser or addgroup commands, but we need more details like the exact Dockerfile you’re using to try and build the image, as well as Docker version and OS of the host you’re building on. :thinking_face:

Hi, @radnov Thanks for your reply. I’m trying to build this dockerfile to create image dhis2/core:2.37.4-tomcat-8.5.34-jre8-alpine.
docker version - Docker version v24.0.2, build cb74dfc
os details - NAME=“Red Hat Enterprise Linux”
VERSION=“8.8 (Ootpa)”
ID=“rhel”
ID_LIKE=“fedora”
VERSION_ID=“8.8”
PLATFORM_ID=“platform:el8”
PRETTY_NAME=“Red Hat Enterprise Linux 8.8 (Ootpa)”

error log -
Sending build context to Docker daemon 4.096kB
Step 1/15 : ARG TOMCAT_IMAGE
Step 2/15 : FROM Docker
—> d7dd38019f54
Step 3/15 : ARG IDENTIFIER=unknown
—> Using cache
—> 26db0c0703da
Step 4/15 : LABEL identifier=${IDENTIFIER}
—> Using cache
—> 65189d5ac3d1
Step 5/15 : ENV WAIT_FOR_DB_CONTAINER=“”
—> Using cache
—> 13b8e95f0ff0
Step 6/15 : ENV DHIS2_HOME=/DHIS2_home
—> Using cache
—> 5499a20a3746
Step 7/15 : RUN rm -rf /usr/local/tomcat/webapps/* && mkdir /usr/local/tomcat/webapps/ROOT && mkdir $DHIS2_HOME && addgroup -S tomcat && addgroup root tomcat && adduser -S -D -G tomcat tomcat && echo ‘tomcat’ >> /etc/cron.deny && echo ‘tomcat’ >> /etc/at.deny
—> Running in 5940e386be73
Option s is ambiguous (shell, system)
adduser [–home DIR] [–shell SHELL] [–no-create-home] [–uid ID]
[–firstuid ID] [–lastuid ID] [–gecos GECOS] [–ingroup GROUP | --gid ID]
[–disabled-password] [–disabled-login] [–add_extra_groups]
[–encrypt-home] USER
Add a normal user

adduser --system [–home DIR] [–shell SHELL] [–no-create-home] [–uid ID]
[–gecos GECOS] [–group | --ingroup GROUP | --gid ID] [–disabled-password]
[–disabled-login] [–add_extra_groups] USER
Add a system user

adduser --group [–gid ID] GROUP
addgroup [–gid ID] GROUP
Add a user group

addgroup --system [–gid ID] GROUP
Add a system group

adduser USER GROUP
Add an existing user to an existing group

general options:
–quiet | -q don’t give process information to stdout
–force-badname allow usernames which do not match the
NAME_REGEX[_SYSTEM] configuration variable
–extrausers uses extra users as the database
–help | -h usage message
–version | -v version number and copyright
–conf | -c FILE use FILE as configuration file

The command ‘/bin/sh -c rm -rf /usr/local/tomcat/webapps/* && mkdir /usr/local/tomcat/webapps/ROOT && mkdir $DHIS2_HOME && addgroup -S tomcat && addgroup root tomcat && adduser -S -D -G tomcat tomcat && echo ‘tomcat’ >> /etc/cron.deny && echo ‘tomcat’ >> /etc/at.deny’ returned a non-zero code: 1

Hi @Gassim @radnov any pointers on this?

Hey @Shreya_Kajbaje, sorry for the late reply.

How are you executing the docker build command to get this error? Note that 2.37.4 used a now deprecated process of building Docker images which we’ve changed a lot since.

Are you following the docker directory README file for that tag? https://github.com/dhis2/dhis2-core/blob/2.37.4/docker/README.md

It would be helpful if you can share all the steps you took to end up at the error you’re getting.

Hi @Shreya_Kajbaje

On a side note, can I ask you why you are trying to build 2.37.4, rather than the latest patch 2.37.10?
There are legitimate reasons to build older patches, of course, but for production systems the latest stable patch should always be used in order to avoid security vulnerabilities in particular.

Kind regards,
Phil

1 Like