Ensure you are running in the correct environment or set the correct configuration file with -c

Hi,

using the Dockerfile below, I get the error message, which is even further below. My guess for the reason is, that the app.ini file doesn’t yet exist. So, how would I get it created?

Docker file:

FROM gitea/gitea:1.16.5
EXPOSE 3000 22
RUN apk add mlocate emacs runuser
RUN GITEA__security__INSTALL_LOCK=true runuser -u git -- /usr/local/bin/gitea -c /data/gitea/conf/app.ini admin user create --admin --username root -password manage --email noreply@softwareag.com

Output from “docker build”:

> [3/3] RUN GITEA__security__INSTALL_LOCK=true runuser -u git -- /usr/local/bin/gitea -c /data/gitea/conf/app.ini admin user create --admin --username root -password manage --email noreply@softwareag.com:
#7 1.091 2022/03/31 14:29:26 ...s/setting/setting.go:587:loadFromConf() [F] Unable to find configuration file: "/data/gitea/conf/app.ini".
#7 1.091        Ensure you are running in the correct environment or set the correct configuration file with -c.
------
executor failed running [/bin/sh -c GITEA__security__INSTALL_LOCK=true runuser -u git -- /usr/local/bin/gitea -c /data/gitea/conf/app.ini admin user create --admin --username root -password manage --email noreply@mycompany.com]: exit code: 1