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
Docker: Rework #14626
Docker: Rework #14626
Conversation
Thanks for contributing! +1 for shellcheck. Can you explain what you mean by wanting more flexibility? I've been doing some work recently on my own docker environment. I'm quite happy with how it's ended up, so I thought I might share in case you find it useful. I left all of the s6 stuff pretty much as is because I don't know much about it. Curious if you don't think it's useful. Currently, I'm trying to make the same process work with rootless docker. |
Also hadolint (https://github.com/hadolint/hadolint) which is fork of shellcheck designed to be used in dockerfiles.
I find the current design too limiting as it makes it difficult to deploy multiple gitea instances with different configuration files and databases for testing purposes. So this way it's generating the Note that currently this design is not meant to be used for production as it's depending on I also find it too limiting to have it depending on volumes so i've designed it to use FHS3_0 service directory (/srv/gitea) that allows for root/rootless without the need for second dockerfile and if desired the service operators can define volumes through docker-compose. Looking at the provided gist
I've done this through the shell wrapper that is using About the env-file i found that too limiting as it doesn't support string replacement with default value: # Sets variable kreyren to store value 'default' unless kreyren is already set
export kreyren="${kreyren:-"default"}" It seems that docker is using a simple python interpreter to set these variables that are then not available in the
My design expects the runtime defined within the |
@kdumontnu Btw. i am happy to discuss my design decisions more if you want to adapt them for your design. |
I don't see that is possible to specify what user context to run gitea in (user/group/uid/gid) from environment variables. |
Data defined in https://github.com/go-gitea/gitea/pull/14626/files#diff-7056ac181b6ee63e9510d8b82a9be9d372e8d2d01e207f893d29bb184e4b133bR55 which will be processed further Expected configuration is:
I plan to add a handling to make this changable on runtime through the provided and optional script.
I find that yes i want to do something like this, but i also want to cache the step during a build. Note that the handling is not full implemented and that this was created to aid development of #14644 I will be reworking this whole merge request based on my finding from that development and feedback here. Added your #14780 in the TODO list. |
my fault! |
@Kreyren I haven't followed the full discussion but it seems this PR is not going to be merged, isn't it? Can we close here? |
I was just wondering since I haven't read whether the proposed changes will be accepted in the end and there are a lof of conflicts in the current PR :) Just wanted to check base and clean up a bit - the decision whether to close is on you :) |
!!! DO NOT MERGE !!!
I've reworked the docked backend, because i needed a more flexible development environment.
Do you want this in gitea? I would polish it more prior to merge and implement handling for other databases. ^-^
The important files are:
Blocked by: #14644 (This Merge Request will be finished after this one assuming that upstream wants it)
TODO
Please check the following:
master
branch, pull requests on release branches are only allowed for bug fixes.Done - Krey
To comply with https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md#discuss-your-design:
This implement handling through variables allowing to change the file hierarchy and used configuration during a build time and on runtime through the use of
docker-compose
on which it does not have hard dependency (uses script that generates the config from variables that is called from docker-compose'scommand
otherwise it usesgitea web
)It's designed to avoid maintaining two dockerfiles to make the maintenance more efficient by avoiding duplicate code through utilizing FHS3_0 service directory in alpine image to allow root and rootless run with option to run in a sandbox (e.g. chroot) within a docker environment.
To comply with https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco:
Will be provided prior to non-draft merge request
Originally designed to test implementation to r e s o l v e #14562 intended to provide multiple services in a dockerfile to make sure that the implementation works with supported databases and to implement tests.