dockersecureimages / nexus3

Nexus3 docker secure image
0 stars 0 forks source link

make INSTALL4J_ADD_VM_PARAMS available #3

Open ssproessig-thales opened 3 years ago

ssproessig-thales commented 3 years ago

In the official Dockerfile at https://github.com/sonatype/docker-nexus3/blob/master/Dockerfile#L76 the environment variable INSTALL4J_ADD_VM_PARAMS is set to

ENV INSTALL4J_ADD_VM_PARAMS="-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs"

and can be overwritten. This is not possible to overwrite from the secureimage but is required in our current setup.

Maybe add it? Thank you!

ssproessig-thales commented 3 years ago

please also see the official image chef ruby (thanks to Carsten) which removes memory options from vmoptions

ruby_block "remove java memory settings from nexus.vmoptions" do
  block do
    file = Chef::Util::FileEdit.new(node['nexus_repository_manager']['nexus_home']['path'] + '/bin/nexus.vmoptions')
    file.search_file_delete_line(/^-Xms/)
    file.search_file_delete_line(/^-Xmx/)
    file.search_file_delete_line(/^-XX:MaxDirectMemorySize/)
    file.write_file
  end
end

https://github.com/sonatype/chef-nexus-repository-manager/blob/master/recipes/docker.rb#L29