Comments (10)
The main idea of this image was to make if easy for anyone to tryout/use gitlab without having to deal with setting up the system or gitlab configuration files etc. Like a plug and play kinda thing.
Over a period of time I started adding all these configuration options so that users could customize their instance without having to directly deal with the configuration files.
Scalability wise I don't see any issues here. In fact its simple to start multiple instances of the image when you need to do load balancing stuff.
Having said that, I do like your idea of being able to pick up the configuration from a config directory so that more advanced users can customize the configuration to their liking. This could be implemented as an alternate configuration method such that if such a configuration is present, it will override all environment variable settings.
Currently all of gitlab data is mounted at /home/git/data, so we can look for a config directory within this path and pick the configurations for gitlabhq and gitlab-shell from this directory. I think this could work well and not interfere with users who are already using this image in its current form.
Let me know your thoughts.
Since you mentioned that you are new to docker, I advise you to take a look at:
- http://crosbymichael.com/dockerfile-best-practices.html
- https://github.com/paulczar/docker-wordpress
Regards
~Sameer
from docker-gitlab.
Thank you for responding so quickly and for elaborating on the matter. I'd have to say I agree with you in full. Command-line parameters are easy to use, handy for multiple instances and newb-friendly - although I have to say well documented configuration files are not that hard to use either. :)
Besides keeping this image backwards compatible, I also think allowing to override individual configuration files will be a good approach. In this way you can - for example - fully configure NGinx, but let the rest of the configuration be generated automatically by the command-line parameters.
The implementation of this feature will be quite easy I believe:
- Adding a default configuration setup archive to this repository. The default configuration is pretty well documented already (https://github.com/gitlabhq/gitlabhq/tree/master/config);
- Writing file existance checks around each configuration file generation (
if exists: copy existing, else: generate
); - Updating documentation accordingly.
- Mentioning overridable configuration files (when placed in
/opt/gitlab/data/config
); - Add override setup script, something like:
curl -L https://raw.github.com/sameersbn/docker-gitlab/master/resources/setup/gitlab-config-1.8.0.tar.gz -s -o - | tar -xzf --directory /opt/gitlab/data -
- Mentioning overridable configuration files (when placed in
You'd agree?
Though, what if you specify a command-line parameter, but have a configuration file in place? Wouldn't it then be better to use the existing file as a base, and replace the given options in the local copy?
PS: Thanks for the advice! Appreciate it.
from docker-gitlab.
What do you mean by "Add override setup script". Are you saying that
- the image should pull the default configuration when its run?
- or do you mean informing users (in the documentation) where to get the sample configs from if case they prefer editing the configs by hand.
By "command-line parameter" you mean something like 'docker run sameersbn/gitlab app:start --db_host "192.168.1.100" --db_port="10000"' and so on right? So basically instead of env variables we do getopt parsing.
Actually, I had started off with this image the same way. Can't remember why I ditched it though. However it would still not fix your original request, unless all possible configurable parameters are tunable this way.
from docker-gitlab.
With "Add override setup script" I mean adding an archive (for example resources/setup/gitlab-config-6.4.3.tar.gz
) which contains the default configuration files (something equivalent to this folder: https://github.com/crashsystems/gitlab-docker/tree/master/config) and inform the users in the documentation. In this way it can be retrieved/installed with curl/wget without having to pull the entire repository (like the crashsystems/gitlab-docker does require you to do).
By "command-line parameter" I basically mean passing something along with a terminal command. In this case the environment variables of docker run
, but getopt parsing is an option too. Although the latter is a cleaner way in my opinion, it's not my preferred choice. Mainly because of the backwards compatible issue.
If we'll ingore backwards compatibility though, I'd advise to remove the env variables entirely. For several reasons:
- A bit higher learning curve, but just one straightforward way of configuring the GitLab instance;
- I'd apply the 80-20 rule to the multiple instance case, where a copy of the configuration will be an option too;
- No trouble with adding given env variables into the given configuration files, which will be painfully bug-sensitive.
Ignoring the env variables when configuration files are present would be an option too, except the given env variables can then be misleading. Also if you have a partial selection of the configuration files available and allow this tool to generate the rest (according to the given env variables), I think it will become a mess and also less newb-friendly.
In conclusion, the easy way would be to only allow the configuration files and make them mandatory.
from docker-gitlab.
@sameersbn Any other thoughts on this?
from docker-gitlab.
Will be working on this soon. Just a little caught up with work.
This feature should be implemented before the next gitlab release.
from docker-gitlab.
I understand. Please let me know if there's anything I can help with.
from docker-gitlab.
@mauvm Hi and sorry for leaving this request open ended for so long. I finally got to it and the changes have been committed to the master. Have yet to get to updating the README. Here is a short version
Extract https://github.com/sameersbn/docker-gitlab/blob/master/resources/setup/config.tar.bz2 to your data directory and edit the logs as per your liking (be careful though).
The variables that are surrounded by the {{}} markers are the ones that are updated at runtime. You can edit this to hold the final value and omit passing the values as environment variable parameters. For example if you are using an external mysql server connection at 192.168.1.100, you can change {{DB_HOST}} in gitlabhq/gitlab.yml to the ip address and so on.
Other configuration parameters can be edited as per your liking.
Make sure you do not change any path variables, you are destined to be doomed if you do.
Let me know if you run into any issues.
from docker-gitlab.
P.S. If all works fine, please close this request. Then I will officially document this feature.
from docker-gitlab.
Thanks! Will try it out.
from docker-gitlab.
Related Issues (20)
- 16.7.0: Rake aborts launch with "failed to get urandom" HOT 36
- Migrate gitlab 11.10.4 to gitlab 16.6.2 with mysql to postgresql
- Error fetching repo data HOT 1
- CVE-2023-7028 HOT 3
- Upgrade Ruby to 3.2.x to remove bug introduced on Ruby 3.1.x HOT 4
- Unable to fetch commit when using --depth 1 mode
- GitLab Critical Security Release: 16.8.1, 16.7.4, 16.6.6, 16.5.8 HOT 1
- How to backup GitLab in Kubernetes? Do you have any good ideas, templates, or documentation? I'm not very familiar with Kubernetes, so please help me. HOT 2
- Backups not functioning in v16.8.1 HOT 3
- [Question] How to change the clone link from localhost to my domain? HOT 2
- Support setting `global_time_tracking_report` HOT 1
- I have set up an auto-backup strategy in Kubernetes, but it seems not to take effect. How can I troubleshoot the problem? HOT 9
- How is openid_connect_signing_key handled? HOT 1
- level=error correlation_id= duration_ms=0 error="badgateway: failed to receive response: dial unix /home/git/gitlab/tmp/sockets/gitlab.socket: connect: no such file or directory
- Please support pages namespace_in_path
- Web log-in broken HOT 2
- missing 16.1.6 and 16.3.7 version needed for upgrade path HOT 14
- postgres (PostgreSQL) 15.1 (Debian 15.1-1.pgdg110+1) image no longer exists HOT 5
- im trying to deploy my flutter web app on github pages
- Unable to upgrade from 16.1.5 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-gitlab.