Reading through that, I wonder why the following doesn’t work:
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 thepassword --email noreply@mycompany.com
RUN cat /data/gitea/conf/app.ini | sed -e s/3000/8081/ > /data/gitea/conf/app.ini.new
RUN mv /data/gitea/conf/app.ini.new /data/gitea/conf/app.ini
The error I am getting:
[3/5] RUN GITEA__security__INSTALL_LOCK=true runuser -u git – /usr/local/bin/gitea -c /data/gitea/con
f/app.ini admin user create --admin --username root --password thepassword --email noreply@mycompany.com:
#6 0.317 2022/07/22 12:43:16 …s/setting/setting.go:587:loadFromConf() [F] Unable to find configuration
file: “/data/gitea/conf/app.ini”.
#6 0.317 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 thepassword --email norerly@mycompany.com]: exit code: 1
ERROR: Service ‘gitrepo’ failed to build : Build failed