愿君学长松,慎勿作桃李。这篇文章主要讲述docker-compose安装nexus3相关的知识,希望能为你提供帮助。
安装前的准备准备
如果本机是首次使用docker-compose环境部署,需要在在/deploy/sorts创建以下脚本并执行
vi pre_install.sh
vi pre_install.sh
#!/bin/bash
###关闭selinux
sed -i \'s/SELINUX=enforcing/SELINUX=disabled/g\' /etc/selinux/config
setenforce 0
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce
###配置拉取国内镜像仓库
tee /etc/docker/daemon.json <
<
-\'EOF\'
{
"registry-mirrors": [
"https://5sr5uink.mirror.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
],
"insecure-registries": ["harbor.xxx.com"]
}
EOF
###启动docker
systemctl start docker
systemctl enable docker
### 下载docker-compose
curl -L "https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
chmod +x /usr/bin/docker-compose
docker-compose -version
【docker-compose安装nexus3】sh pre_install.sh
创建nexus目录及相关子目录
mkdir /deploy/sorts/nexus3
cd /deploy/sorts/nexus3
mkdir data
创建yml编排文件
vi docker-compose.yml
version: \'3.7\'
services:
nexus:
image: harbor.xxx.com/xxx/nexus3
restart: always
container_name: nexus3
ports:
- "8081:8081"
volumes:
- ./data:/nexus-data
environment:
- TZ=Asia/Shanghai
创建启动和停止脚本
vi up.sh
#!/bin/bashset -etm=`date +%Y%m%d-%H%M%S`
echo "====================================================="
echo "Starting nexus3."
echo "Starting <
${tm}>
."
echo "====================================================="
echo "Please ensure the config files right."
echo "====================================================="docker-compose-p nexus3 up -d
vi down.sh
#!/bin/bashset -etm=`date +%Y%m%d-%H%M%S`
echo "====================================================="
echo "Stopping nexus3."
echo "Stopping <
${tm}>
."
echo "====================================================="
echo "Please ensure the config files right."
echo "====================================================="docker-compose -p nexus3 down
启动
sh ups.sh
[root@localhost-203-root-all nexus3]# docker-compose ps
NameCommandStatePorts
------------------------------------------------------------------------------------------
nexus3sh -c ${SONATYPE_DIR}/star ...Up0.0.0.0:8081->
8081/tcp,:::8081->
8081/tcp
配置阿里云缓存仓库
浏览器访问nexus所在节点IP+8081
设置--Repository--Create Repository----Maven2(proxy)
在Remote Storage里面填上阿里云私库地址http://maven.aliyun.com/nexus/content/groups/public/
文章图片
推荐阅读
- Linux From Scratch(LFS11.0)构建 LFS 系统 - Elfutils-0.185 中的 Libelf
- Centos8安装java部署环境
- win xp系统下可以将QQ语音文件下载下来吗
- 教大家win xp系统下如何将腾讯视频设置为全速下载模式
- 教大家win xp系统下将百度首页的皮肤更改为自己喜欢的图片
- win xp系统下迅雷看看的字幕样式怎样更改
- win xp系统下如何将自己喜欢的QQ浏览器页面快捷方式添加到桌面
- 教大家不用Photoshop就能迅速查看psd文件的办法
- win xp系统下用WPS打印时如何更改PDF文件的大小