启动 Nexus docker 图像时如何设置管理员 user/pwd

How to set admin user/pwd when launching Nexus docker image

启动 Nexus 2 时 docker 图片 ( https://hub.docker.com/r/sonatype/nexus/ ) 如何配置它以将默认管理员用户密码更改为 admin/admin123 以外的密码?

谢谢。

@Zeitounator, 感谢您的回答,但实际上我确实设法更改了管理员密码。 在 docker 图像中,您需要更新 /sonatype-work/conf/security.xml 文件。 有一个管理部分,您需要在其中更改密码元素

<user>
  <id>admin</id>
  <firstName>Administrator</firstName>
  <lastName>User</lastName>
  <password>change_password_here</password>
  <status>active</status>
  <email>changeme@yourcompany.com</email>
</user>

我正在使用 kubernetes 启动 Nexus,通过安装正确的文件,我能够更改密码。

为了生成密码,我使用了 shiro 工具 hasher cli:https://shiro.apache.org/command-line-hasher.html

如需首次更改管理员密码,请按照以下步骤操作(docker 仅限版本):

转到 Nexus 容器实例,例如 91aefe723146

  make a docker exec -it 91aefe723146 /bin/bash
  

转到 /nexus-data

  get the password content of the file admin.password

再次登录到管理控制台并输入密码并重新设置密码。 完成!