一、安装环境
#查看centOS版本
[root@MiWiFi-R4CM-srv network-scripts]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
#自动查找最新安装包并升级
[root@MiWiFi-R4CM-srv ~]# sudo yum upgrade
二、关闭firewalld、NetworkManager、selinux
关闭防火墙、网络管理、强制访问控制,避免网络安全进程对访问造成影响
[root@MiWiFi-R4CM-srv test]# systemctl stop firewalld NetworkManager
[root@MiWiFi-R4CM-srv test]# systemctl disable firewalld NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@MiWiFi-R4CM-srv test]# vim /etc/selinux/config
SELINUX=disabled
三、docker
3.1 安装依赖
yum-util提供yum-config-manager功能
device-mapper-persistent-data和lvm2是devicemapper驱动依赖
[root@MiWiFi-R4CM-srv ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
软件包 yum-utils-1.1.31-54.el7_8.noarch 已安装并且是最新版本
软件包 device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64 已安装并且是最新版本
软件包 7:lvm2-2.02.187-6.el7_9.5.x86_64 已安装并且是最新版本
无须任何处理
[root@MiWiFi-R4CM-srv ~]#
3.2 设置yum软件源
阿里源:http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@MiWiFi-R4CM-srv ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
已加载插件:fastestmirror, langpacks
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@MiWiFi-R4CM-srv ~]#
3.3 更新yum软件包索引
[root@MiWiFi-R4CM-srv ~]# yum makecache fase
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/4): docker-ce-stable/7/x86_64/filelists_db | 45 kB 00:00:00
(2/4): docker-ce-stable/7/x86_64/updateinfo | 55 B 00:00:00
(3/4): docker-ce-stable/7/x86_64/primary_db | 111 kB 00:00:00
(4/4): docker-ce-stable/7/x86_64/other_db | 133 kB 00:00:00
元数据缓存已建立
[root@MiWiFi-R4CM-srv ~]#
3.4 安装docker
[root@MiWiFi-R4CM-srv ~]# yum install docker-ce docker-ce-cli containerd.io
已安装:
containerd.io.x86_64 0:1.6.21-3.1.el7 docker-ce.x86_64 3:24.0.2-1.el7 docker-ce-cli.x86_64 1:24.0.2-1.el7
作为依赖被安装:
container-selinux.noarch 2:2.119.2-1.911c772.el7_8 docker-buildx-plugin.x86_64 0:0.10.5-1.el7 docker-ce-rootless-extras.x86_64 0:24.0.2-1.el7 docker-compose-plugin.x86_64 0:2.18.1-1.el7
fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 fuse3-libs.x86_64 0:3.6.1-4.el7 slirp4netns.x86_64 0:0.4.3-4.el7_8
完毕!
[root@MiWiFi-R4CM-srv ~]#
[root@MiWiFi-R4CM-srv ~]# docker version
Client: Docker Engine - Community
Version: 24.0.2
API version: 1.43
Go version: go1.20.4
Git commit: cb74dfc
Built: Thu May 25 21:55:21 2023
OS/Arch: linux/amd64
Context: default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@MiWiFi-R4CM-srv ~]#
3.5 启动docker
[root@MiWiFi-R4CM-srv ~]# systemctl start docker
[root@MiWiFi-R4CM-srv ~]# ps -e | grep docker
17889 ? 00:00:00 dockerd
[root@MiWiFi-R4CM-srv ~]#
3.6 设置docker开机自启动
[root@MiWiFi-R4CM-srv ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@MiWiFi-R4CM-srv ~]#
四、docker-compose
4.1 安装docker-compose失败
docker-compose是docker的多容器管理工具
?下载失败,提示没有可用的docker-compose软件包
[root@MiWiFi-R4CM-srv ~]# yum install docker-compose -y
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
没有可用软件包 docker-compose。
错误:无须任何处理
[root@MiWiFi-R4CM-srv ~]#
解决办法:安装epel-release
EPEL(Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux。我们在Centos下使用yum安装时往往找不到rpm的情况,官方的rpm repository提供的rpm包也不够丰富,很多时候需要自己编译很痛苦,而EPEL恰恰可以解决这两方面的问题。EPEL的全称叫 Extra Packages for Enterprise Linux 。EPEL是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。装上了 EPEL之后,就相当于添加了一个第三方源。
[root@MiWiFi-R4CM-srv ~]# sudo yum -y install epel-release
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成
依赖关系解决
==================================================================================================================================================================================================================
Package 架构 版本 源 大小
==================================================================================================================================================================================================================
正在安装:
epel-release noarch 7-11 extras 15 k
事务概要
==================================================================================================================================================================================================================
安装 1 软件包
总下载量:15 k
安装大小:24 k
Downloading packages:
epel-release-7-11.noarch.rpm | 15 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : epel-release-7-11.noarch 1/1
验证中 : epel-release-7-11.noarch 1/1
已安装:
epel-release.noarch 0:7-11
完毕!
[root@MiWiFi-R4CM-srv ~]#
4.1 安装docker-compose成功
[root@MiWiFi-R4CM-srv ~]# yum install docker-compose -y
已安装:
docker-compose.noarch 0:1.18.0-4.el7
作为依赖被安装:
python3.x86_64 0:3.6.8-18.el7 python3-libs.x86_64 0:3.6.8-18.el7 python3-pip.noarch 0:9.0.3-8.el7 python3-setuptools.noarch 0:39.2.0-10.el7
python36-PyYAML.x86_64 0:3.13-1.el7 python36-cached_property.noarch 0:1.5.1-2.el7 python36-chardet.noarch 0:3.0.4-1.el7 python36-docker.noarch 0:2.6.1-3.el7
python36-docker-pycreds.noarch 0:0.2.1-2.el7 python36-dockerpty.noarch 0:0.4.1-18.el7 python36-docopt.noarch 0:0.6.2-8.el7 python36-idna.noarch 0:2.10-1.el7
python36-jsonschema.noarch 0:2.5.1-4.el7 python36-pysocks.noarch 0:1.6.8-7.el7 python36-requests.noarch 0:2.14.2-2.el7 python36-six.noarch 0:1.14.0-3.el7
python36-texttable.noarch 0:1.6.2-1.el7 python36-urllib3.noarch 0:1.25.6-2.el7 python36-websocket-client.noarch 0:0.47.0-2.el7
完毕!
[root@MiWiFi-R4CM-srv ~]#
[root@MiWiFi-R4CM-srv ~]# docker-compose -v
docker-compose version 1.18.0, build 8dd22a9
[root@MiWiFi-R4CM-srv ~]#
五、git
5.1 安装git
[root@MiWiFi-R4CM-srv ~]# yum install git -y
已安装:
git.x86_64 0:1.8.3.1-25.el7_9
作为依赖被安装:
perl-Error.noarch 1:0.17020-2.el7 perl-Git.noarch 0:1.8.3.1-25.el7_9 perl-TermReadKey.x86_64 0:2.30-20.el7
完毕!
[root@MiWiFi-R4CM-srv ~]# git version
git version 1.8.3.1
[root@MiWiFi-R4CM-srv ~]#
5.2 拉取部署文件
[root@MiWiFi-R4CM-srv ~]# pwd
/root
[root@MiWiFi-R4CM-srv ~]# cd /opt && git clone https://github.com/DrumSergio/GenieACS-Docker && cd GenieACS-Docker
正克隆到 'GenieACS-Docker'...
remote: Enumerating objects: 455, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 455 (delta 94), reused 159 (delta 81), pack-reused 276
接收对象中: 100% (455/455), 97.37 KiB | 0 bytes/s, done.
处理 delta 中: 100% (266/266), done.
[root@MiWiFi-R4CM-srv GenieACS-Docker]# pwd
/opt/GenieACS-Docker
[root@MiWiFi-R4CM-srv GenieACS-Docker]#
六、部署drumsergio/genieacs
6.1 docker拉取镜像文件
#docker search 在镜像仓库搜索
[root@MiWiFi-R4CM-srv GenieACS-Docker]# docker search drumsergio/genieacs
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
drumsergio/genieacs GenieACS is an ACS server TR069-compliant 12
drumsergio/genieacs-sim 0
#docker pull 从镜像仓库拉取
[root@MiWiFi-R4CM-srv GenieACS-Docker]# docker pull drumsergio/genieacs
Using default tag: latest
latest: Pulling from drumsergio/genieacs
9b99af5931b3: Pull complete
b6013b3e77fe: Pull complete
bbced17b6899: Pull complete
8b609dabefa8: Pull complete
50544bfef33d: Pull complete
fea3f8b8e075: Pull complete
6aa481ae8144: Pull complete
71f98fadae3b: Pull complete
34ff852d2cb3: Pull complete
3632a34720ae: Pull complete
c4c8185e4c3a: Pull complete
4f4fb700ef54: Pull complete
59f535a44aba: Pull complete
afe1ccff1bdc: Pull complete
7931bf6f4e57: Pull complete
9d819148ebfe: Pull complete
89f8fecc5c6c: Pull complete
0247a896cb9c: Pull complete
7ff09a61d343: Pull complete
8978666e6c9f: Pull complete
62f542c9ddff: Pull complete
6080cfc727c2: Pull complete
deab82611ba6: Pull complete
0e6a01d3bc82: Pull complete
b3c4be8a7dcb: Pull complete
6096d412270c: Pull complete
Digest: sha256:b502b7f5d8982d798775b64c45856a038dc7a4496a5bd9af8e891194fb73a835
Status: Downloaded newer image for drumsergio/genieacs:latest
docker.io/drumsergio/genieacs:latest
[root@MiWiFi-R4CM-srv GenieACS-Docker]#
#查看镜像是否拉取成功
[root@MiWiFi-R4CM-srv GenieACS-Docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
drumsergio/genieacs latest c3ca335d7d2b 17 months ago 1.21GB
[root@MiWiFi-R4CM-srv GenieACS-Docker]#
#如果已拉取过再次执行会如下提示
[root@MiWiFi-R4CM-srv GenieACS-Docker]# docker search drumsergio/genieacs
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
drumsergio/genieacs GenieACS is an ACS server TR069-compliant 12
drumsergio/genieacs-sim 0
[root@MiWiFi-R4CM-srv GenieACS-Docker]# docker pull drumsergio/genieacs
Using default tag: latest
latest: Pulling from drumsergio/genieacs
Digest: sha256:b502b7f5d8982d798775b64c45856a038dc7a4496a5bd9af8e891194fb73a835
Status: Image is up to date for drumsergio/genieacs:latest
docker.io/drumsergio/genieacs:latest
[root@MiWiFi-R4CM-srv GenieACS-Docker]# ls
charts docker-compose.yml Dockerfile Dockerfile-alpine genieacs-deploy-helmfile genieacs.logrotate LICENSE README.md Vagrantfile
[root@MiWiFi-R4CM-srv GenieACS-Docker]#
[root@MiWiFi-R4CM-srv GenieACS-Docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
drumsergio/genieacs latest c3ca335d7d2b 17 months ago 1.21GB
[root@MiWiFi-R4CM-srv GenieACS-Docker]#
6.2 docker-compose启动drumsergio/genieacs
[root@MiWiFi-R4CM-srv GenieACS-Docker]#
[root@MiWiFi-R4CM-srv GenieACS-Docker]# docker-compose up -d
Creating network "genieacsdocker_genieacs_network" with the default driver
Creating volume "genieacsdocker_data_db" with default driver
Creating volume "genieacsdocker_data_configdb" with default driver
Creating volume "genieacsdocker_opt_volume" with default driver
Pulling mongo (mongo:4.4)...
4.4: Pulling from library/mongo
f0412dfb1aae: Pull complete
53df01b8802d: Pull complete
ad8a86eac8b1: Pull complete
322659b0c253: Pull complete
c2e5757a4725: Pull complete
a4297db77d3d: Pull complete
82d8af276f8e: Pull complete
3e4a26f395f6: Pull complete
3d0007c16cd3: Pull complete
Digest: sha256:44ab443d63b8bf211ead7c8ff5ffe481820e118bca33d970c626cfc38094aaef
Status: Downloaded newer image for mongo:4.4
Pulling genieacs (drumsergio/genieacs:1.2.9)...
1.2.9: Pulling from drumsergio/genieacs
4e2befb7f5d1: Pull complete
792af667f626: Pull complete
3e37868ebf66: Pull complete
591fe17e35dd: Pull complete
b9cba6e3073a: Pull complete
5d54aff43b9d: Pull complete
94704c6ed815: Pull complete
6a29537f8b68: Pull complete
33653a0104b5: Pull complete
b47afd6e8f25: Pull complete
12f58adaa1e6: Pull complete
4f4fb700ef54: Pull complete
3d47fdb9ca12: Pull complete
0d96c007e333: Pull complete
5e59bf7c4b74: Pull complete
93d8d6d0aee8: Pull complete
9441aa144636: Pull complete
a57a2969e3f9: Pull complete
a7218095f143: Pull complete
1919cfb42359: Pull complete
2f0fcd55bccb: Pull complete
d0dab9ef941e: Pull complete
06408ea64b09: Pull complete
f67bf4c130a3: Pull complete
1b10776001da: Pull complete
25014ac6f666: Pull complete
Digest: sha256:d38f85a3b80a284323f5895908734647b57bbfd4f602860f651b8dbaa949eb6d
Status: Downloaded newer image for drumsergio/genieacs:1.2.9
Pulling genieacs-sim (drumsergio/genieacs-sim:latest)...
latest: Pulling from drumsergio/genieacs-sim
e7c96db7181b: Pull complete
50958466d97a: Pull complete
56174ae7ed1d: Pull complete
284842a36c0d: Pull complete
c962ca5a810c: Pull complete
1ba6020f702b: Pull complete
a9c22a55f6ae: Pull complete
Creating mongo ... done
Creating genieacs ... done
Creating genieacs-sim ... done
Creating genieacs ...
Creating genieacs-sim ...
[root@MiWiFi-R4CM-srv GenieACS-Docker]#
七、管理drumsergio/genieacs
7.1 页面部署drumsergio/genieacs
全部勾选上即可