# Unattended Gitea installation from the CLI

**URL:** <https://forum.gitea.com/t/unattended-gitea-installation-from-the-cli/3373>\
**Category:** Install/Maintain/Configure\
**Created:** [June 15, 2021, 3:24pm UTC](https://forum.gitea.com/t/unattended-gitea-installation-from-the-cli/3373 "2021-06-15T15:24:43Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![JochenW](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jochenw/32/5046_2.png) [@JochenW](https://forum.gitea.com/u/JochenW)\
**Post date:** [July 22, 2022, 12:55pm UTC](https://forum.gitea.com/t/unattended-gitea-installation-from-the-cli/3373/27 "2022-07-22T12:55:27Z")

</div>

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](mailto: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](mailto: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](mailto:norerly@mycompany.com)]: exit code: 1

ERROR: Service ‘gitrepo’ failed to build : Build failed

---

<div class="post-metadata">

**Author:** ![dachary](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/dachary/32/4990_2.png) [@dachary](https://forum.gitea.com/u/dachary)\
**Post date:** [July 26, 2022, 5:24am UTC](https://forum.gitea.com/t/unattended-gitea-installation-from-the-cli/3373/28 "2022-07-26T05:24:09Z")

</div>

Could you please surround the script output with ``` so that it is more readable?

[Previous page](https://forum.gitea.com/t/unattended-gitea-installation-from-the-cli/3373.md?page=1)
