Reference to configuration properties - uid in docker container

Hi,

is there a complete reference for all nexus OSS configuration properties?

How can I change the uid nexus OSS is running as in a container? (like not 200?)

thank you
best regards
Torsten

You can find the code that generates the nexus3 docker image at GitHub - sonatype/docker-nexus3: Dockerized version of Nexus Repo Manager 3. I’m not sure how the uid gets set actually, but it’s not part of the Nexus Repository itself, but rather a part of how the docker image gets generated. This article seems relevant to your question but I’m not super-familiar with how all this works Understanding how uid and gid work in Docker containers | by Marc Campbell | Medium.

Thank you your reply, I had a look into it.
I cloned the master branch of

Here the User used (nexus with uid 200) is not set up by docker and its configs.

The uid of the nexus user is set in the chef-solo cookbook which used to install nexus OSS while building the container.

The chef-solo command used in the Dockerfile of the build fetches a cookbook tarball from github configured as follows:

ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION=“release-0.5.20210628-162332.70a6cb6”
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL=“https://github.com/sonatype/chef-nexus-repository-manager/releases/download/${NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION}/chef-nexus-repository-manager.tar.gz

Unpacking this tarball I find a file:

[…]/cookbooks/nexus_repository_manager/recipes/users.rb

In which the UID 200 is hardcoded…

user ‘nexus’ do
uid ‘200’
[…]

One may now think let’s just change it an feed a custom cookbooks tarball to the chef-solo command in the Dockerfile.

I unpack the /chef-nexus-repository-manager.tar.gz which unpacks to a folder ‘cookbooks’.
I change the uid in the mentioned file to my liking.

pack it again
tar czvf cookbooks.tar.gz cookbooks

Add to Container
ADD ./cookbooks.tar.gz /cookbooks.tar.gz

run chef-solo
[…]
&& chef-solo --recipe-url /cookbooks.tar.gz
–json-attributes /var/chef/solo.json
[…]

this fails with

/opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1293:in copy_stream': Is a directory - read (Errno::EISDIR) from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1293:in block (2 levels) in copy_file’
from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1292:in open' from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1292:in block in copy_file’
from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1291:in open' from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1291:in copy_file’
from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:432:in copy_file' from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:359:in block in cp’
from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1463:in block in fu_each_src_dest' from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1479:in fu_each_src_dest0’
from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:1461:in fu_each_src_dest' from /opt/chef/embedded/lib/ruby/2.5.0/fileutils.rb:358:in cp’
from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.12.9/lib/chef/application/client.rb:547:in fetch_recipe_tarball' from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.12.9/lib/chef/application/client.rb:350:in reconfigure’
from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.12.9/lib/chef/application.rb:64:in run' from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.12.9/lib/chef/application/solo.rb:230:in run’
from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.12.9/bin/chef-solo:24:in <top (required)>' from /usr/bin/chef-solo:75:in load’
from /usr/bin/chef-solo:75:in `’

Well. If somebody is familiar with chef-solo and its whereabouts and has an idea how to solve this, I’d be very thankful for any hints.