Provide different configuration for docker-based omnibus installation

Subsequent recreations of Docker image (can be upgrade) can lead to broken permissions on directories as described here: https://gitlab.com/gitlab-org/gitlab-ce/issues/2023

The problem: This happens, because useradd on fresh system generate accounts with different UIDs.

The fix: pin UIDs to users created by omnibus package.

The implementation:

  1. The simplest solution is to add to gitlab.rb list of UIDs:
## PIN users to UIDs
user['uid'] = 998
user['gid'] = 998
postgresql['uid'] = 996
postgresql['gid'] = 996
redis['uid'] = 997
redis['gid'] = 997
web_server['uid'] = 999
web_server['gid'] = 999
gitlab_ci['uid'] = 995
gitlab_ci['gid'] = 995

However, this doesn't work well for upgrades where gitlab.rb is already generated. I have that implemented.

  1. Implement different defaults for Docker inside omnibus package. This is solution proposed by @marin. He estimates that it will take around one day of work.

  2. Allow to pass gitlab.rb configuration using environment variables. This is solution proposed by me (@ayufan). This would allow us to create Dockerfile with predefined envs. This would allow to override omnibus defaults:

ENV USER_UID 998
ENV USER_GID 998

The environment values would be used (if found) instead of defaults. They could still be overwritten by gitlab.rb.

This is also good, because with support for that we would have docker image that can be configured using environment variables which is requested (and missing) feature.

/cc @marin @jacobvosmaer @Sytse