前言:
此时兄弟们对“centos搭建nexus”大约比较看重,各位老铁们都想要剖析一些“centos搭建nexus”的相关文章。那么小编在网上汇集了一些有关“centos搭建nexus””的相关内容,希望小伙伴们能喜欢,咱们快快来学习一下吧!centos7上安装和配置nexus3并开启docker私服安装jdk
yum install -y java下载nexus
wget解压
tar xvfz nexus-3.15.2-01-unix.tar.gz创建一般用户
useradd nexuschown -R nexus nexus-3.15.2-01chown -R nexus sonatype-work设置为系统自动启动
vim /etc/systemd/system/nexus.service[Unit]Description=nexus serviceAfter=network.target[Service]Type=forkingLimitNOFILE=65536ExecStart=/nexus/nexus-3.15.2-01/bin/nexus startExecReload=/nexus/nexus-3.15.2-01/bin/nexus restartExecStop=/nexus/nexus-3.15.2-01/bin/nexus stopRestart=on-failureUser=nexus[Install]WantedBy=multi-user.targetsystemctl daemon-reloadsystemctl enable nexus.servicesystemctl status nexus.sevice
可以看到系统启动成功:
登录系统
访问,默认的管理员为admin/admin123
更改管理员密码创建用于上传的账号点击即进入系统设置:点击左侧Security->Roles->Create Role(Nexus Role):点击左侧Security->Users->Create local user:创建docker的datastore点击左侧Repository->Blob stores -> Create blob store创建docker-hosted的repository点击左侧Repository->Repositories->Create repository -> docker(hosted)更改nexus的realm点击左侧Security->Realms,把docker beared token realm加进去更改docker配置添加我们的docker私服
vim /etc/docker/daemon.json添加私服ip和端口
"insecure-registries": [ "192.168.4.219:8082"]
systemctl docker restart创建一个tag
docker tag docker.io/mesosphere/marathon-lb:latest 192.168.4.219:8082/marathon-lb:latestdocker登录私服
docker login -u upload -p upload 192.168.4.219:8082push镜像到私服
docker push 192.168.4.219:8082/marathon-lb:latest从私服拉取镜像
docker pull 192.168.4.219:8082/marathon-lb:latest
标签: #centos搭建nexus