推荐镜像部署
安装docker
注意docker国内需要更换源
Centos
yum -y update yum remove docker docker-common docker-selinux docker-engine 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 list docker-ce --showduplicates | sort -r yum -y install docker-ce.x86_64 systemctl start docker systemctl enable docker
Ubuntu
apt-get update apt-get remove docker docker-engine docker.io containerd runc apt-get install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update apt install docker-ce docker-ce-cli containerd.io systemctl start docker systemctl enable docker
导入镜像
下载omc的镜像包omc.tar,在192.168.1.27的目录:/home/data2/back_up/
(可以使用ssh登录192.168.1.27或者192.168.1.28上自行导出镜像包)。
docker import omc.tar omc:latest
启动容器
docker run -itd --name omcd --restart=always --network host omc:latest /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
进入容器更改配置
docker exec -it omcd bash
此时已在容器内部
执行下列命令,运行omcd会重新生成license
rm -rf /omclicense echo "eth0" > /home/ifcName /app/omcd
生成license成功后会自动退出程序,再将/home/ifcName删除
rm -rf /home/ifcName
重启程序看到正常日志即部署成功