docker-gitlab icon indicating copy to clipboard operation
docker-gitlab copied to clipboard

Relative URL Does Not Work If There Is No Access to NPM Registry

Open shplishka opened this issue 1 year ago • 1 comments

When I use GITLAB_RELATIVE_URL_ROOT It reinstalls all the Node modules (Link to Code).

However, when running this in an airgapped environment without access to the NPM registry, it gets stuck because it cannot find the modules to install.

Steps to Reproduce: Set up an airgapped environment without NPM registry access. Use the GITLAB_RELATIVE_URL_ROOT at the specified location in the code.

Expected Behavior The Node modules should not attempt to reinstall, or there should be an alternative method to handle this in an airgapped environment.

Actual Behavior: The process gets stuck and cannot find the modules to install.

Is there a workaround or an alternative approach to handle this situation in an airgapped environment?

link to another issue where i found it - https://github.com/sameersbn/docker-gitlab/issues/2964#issuecomment-2247506803

shplishka avatar Jul 24 '24 10:07 shplishka

One of the major drawbacks would be the large size of the distribution image. So I actually built 2 images - keeping /home/git/gitlab/node_modules or its caches in /home/git/.cache/yarn/* . Here are image sizes comparation. Relative URL works on both tweaked image on VM without internet connection.

node_modules yarn cache image size note
delete delete 3.68GB sameersbn/gitlab:17.2.0
keep delete 5.04GB
delete keep 5.67GB

kkimurak avatar Jul 25 '24 18:07 kkimurak

Well, I noticed that relative url seems to work even if I deleted whole process to recompiling assets (running 17.9.2). Perhaps the recompile process itself is no longer necessary. If so, it may even be possible to reduce the image size. I'll do some more research.

kkimurak avatar Mar 19 '25 08:03 kkimurak

@shplishka Sorry, I'm almost a year late. I identified the upstream commits that justified this and the versions where the corresponding changes were made, so I created a pull request #3122 to avoid recompiling assets even in environments where relative URLs are used. We can run sameersbn/gitlab with relative url in airgapped environment once the PR is merged.

kkimurak avatar Jun 18 '25 09:06 kkimurak