推荐镜像部署
安装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/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
生成license后需要将/home/ifcName删除
rm -rf /home/ifcName
重启容器即完成部署
docker restart omcd