facing errors to build dhis2/core image on power architecture. need assistance with image-building steps and base image support.
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
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.
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
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.
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