其他分享
首页 > 其他分享> > docker利用nexus搭建maven私服

docker利用nexus搭建maven私服

作者:互联网

下载镜像

docker pull sonatype/nexus3

创建映射文件

# 创建文件夹
mkdir /home/nexus3/nexus-data/

# 授权
chmod 777 /home/nexus3/nexus-data/

运行

docker run -d -p 8081:8081 --name nexus -v /home/nexus3/nexus-data:/nexus-data --restart=always sonatype/nexus3

查看密码

密码保存在容器内 admin.password 文件里

# 进入容器
docker exec -it 容器名/容器id /bin/bash

# 查看密码
bash-4.4$ cat /nexus-data/admin.password

# 密码
a406eaf4-9959-4479-ba50-0f366be7a795

测试

# 本地测试
curl http://localhost:8081/

# 返回结果
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Nexus Repository Manager</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <meta name="description" content="Nexus Repository Manager"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <!--[if lt IE 9]>
    <script>(new Image).src="./static/rapture/resources/favicon.ico?_v=3.40.1-01&_e=OSS"</script>
  <![endif]-->
  <link rel="icon" type="image/png" href="./static/rapture/resources/favicon-32x32.png?_v=3.40.1-01&_e=OSS" sizes="32x32">
  <link rel="mask-icon" href="./static/rapture/resources/safari-pinned-tab.svg?_v=3.40.1-01&_e=OSS" color="#5bbad5">
  <link rel="icon" type="image/png" href="./static/rapture/resources/favicon-16x16.png?_v=3.40.1-01&_e=OSS" sizes="16x16">
  <link rel="shortcut icon" href="./static/rapture/resources/favicon.ico?_v=3.40.1-01&_e=OSS">
  <meta name="msapplication-TileImage" content="./static/rapture/resources/mstile-144x144.png?_v=3.40.1-01&_e=OSS">
  <meta name="msapplication-TileColor" content="#00a300">

修改密码

标签:8081,nexus,私服,maven,密码,nexus3,docker,data
来源: https://www.cnblogs.com/2393920029-qq/p/16522248.html