-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot boot docker image when mount a custom app.ini configuration #2197
Comments
Gitea could not remove the file since it is a mount, I think. @ethantkoenig is allready on it to fix and not create a new file. |
For information, this is not specific to that commit. It's just that it need to create a new var to the configuration. If for any reason gitea has to write to the config this will failed even before this commit. |
Yes, it's will be ok if mount on the However, it's not the only use case that people just want to mount the single file of When using docker swarm cluster, mounting a local file/directory to a container is not quite reasonable, because the container might be scheduled to another host, which might not have the Create a config object for $ docker config create gitea-conf app.ini Then create the $ docker service create
--name gitea
-p 80:3000
--config src=gitea-conf,target="/data/gitea/conf/app.ini"
gitea/gitea As you can see, at this point, the configuration object has to be mounted on the file location. Things get even worse in this case, as the configuration object is read-only. So, even the file will only be updated, rather than be replaced, it will still fail if Is that possible we move all the modifications to the database, or other temporary file, and make |
You are right. This was just to confirm the limitation that we have to take in account. A solution is allready in code review #2255 to fix that |
master
branch)2.8.5
[x]
):Description
Since commit 2eeae84, which belongs to #1471, the docker image, which I built with
TAGS="sqlite" make docker
, cannot be booted with anapp.ini
file mounted, and following error will be shown:After dig into the code, I found it's related to this part of code:
https://github.com/go-gitea/gitea/blob/master/modules/setting/setting.go#L831-L838
cfgSave.SaveTo()
is actually create a temporary file first, then write to the temporary file, after that, it then delete the old file, and rename the temporary file to the deleted file name.I think this kind of operation causes the problem, as we
mount
the/data/gitea/conf/app.ini
file inside the docker, sorm
orrename
operation will not be allowed. Here is what I tried to manuallyrm
orrename
the file:The docker image of current version,
v1.1.2
, can be booted without any problem:The text was updated successfully, but these errors were encountered: