一.运行环境
1.1 安装Centos7
安装步骤省略
我使用的是7.5
[root@cxy ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
1.2 更新阿里云镜像源
[root@cxy ~]#wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@cxy ~]#curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@cxy ~]#yum makecache
1.3 关闭firewalld 、NetworkManager
[root@cxy ~]# systemctl stop firewalld NetworkManager
[root@cxy ~]# systemctl disable firewalld NetworkManager
1.4 关闭Selinux
临时关闭
[root@cxy ~]# setenforce 0
永久关闭,修改配置文件
[root@oldboyedu ~]# vim /etc/selinux/config
SELINUX=disabled
1.5 安装常用软件
[root@cxy ~]# yum install -y tree vim wget bash-completion bash-completion-extras lrzsz net-tools sysstat iotop iftop htop unzip telnet ntpdate
二.安装docker-ce
安装依赖
[root@cxy ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
下载yum源
[root@cxy ~]# wget -O /etc/yum.repos.d/docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@cxy ~]# yum makecache fast
安装docker
[root@cxy ~]# yum install -y docker-ce
修改docker镜像加速
[root@cxy ~]# mkdir -p /etc/docker/
[root@cxy ~]# vim /etc/docker/daemon.json
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}
开启服务
[root@cxy ~]# systemctl restart docker
[root@cxy ~]# systemctl enable docker
三.安装docker-compose
[root@cxy ~]# yum install docker-compose -y
查看版本
[root@cxy ~]# docker-compose -v
docker-compose version 1.26.2, build eefe0d31
四.部署genieacs
4.1 从github上拉取部署文件
[root@cxy ~]# cd /opt && git clone https://github.com/DrumSergio/GenieACS-Docker && cd GenieACS-Docker
4.2 拉取镜像文件
[root@cxy GenieACS-Docker]# docker pull drumsergio/genieacs:1.2.0
查看镜像是否拉取到本地
[root@cxy GenieACS-Docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
drumsergio/genieacs 1.2.0 78f20873026d 2 months ago 1.14GB
4.3 使用docker-compose部署服务
[root@cxy GenieACS-Docker]# docker-compose up -d
Creating mongo ... done
Creating genieacs ... done
Creating genieacs-sim ... done
查看服务是否启动成功
[root@cxy GenieACS-Docker]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
50ae3234599e drumsergio/genieacs-sim "docker-entrypoint.s…" About a minute ago Up About a minute genieacs-sim
db96981fab93 drumsergio/genieacs:1.2.0 "docker-entrypoint.s…" About a minute ago Up About a minute 0.0.0.0:3000->3000/tcp, 0.0.0.0:7547->7547/tcp, 0.0.0.0:7557->7557/tcp, 0.0.0.0:7567->7567/tcp genieacs
474fd060b2e4 mongo:4.0 "docker-entrypoint.s…" About a minute ago Up About a minute 27017/tcp mongo
4.4 访问geniesacs
使用主机ip+3000