下载
#Apollo项目包
git clone https://gitee.com/nobodyiam/apollo.git
#安装docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
#找到apollo项目包中docker-compose.yml文件在哪个位置
find ./ -name docker-compose.yml
cd apollo/scripts/docker-quick-start/
docker-compose up #当前终端运行
docker-compose up -d #后台运行
#上述步骤完成后,apollo就已经以容器的形式启动服务了,用docker查看一下相关的容器进程
[root@172 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2ad04bf8e988 nobodyiam/apollo-quick-start "/apollo-quick-start…" 31 minutes ago Up 16 minutes 0.0.0.0:8070->8070/tcp, :::8070->8070/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp apollo-quick-start
f2322135b632 mysql:5.7 "docker-entrypoint.s…" 31 minutes ago Up 16 minutes 33060/tcp, 0.0.0.0:13306->3306/tcp, :::13306->3306/tcp apollo-db
#apollo项目通过compose方式的快速启动会有两个容器存在运行,一个是apollo项目容器,一个是apollo需要的mysqldb容器。
#查看主机下网络服务启动对应的端口占用
[root@172 ~]# netstat -tlunp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 915/sshd
tcp 0 0 0.0.0.0:13306 0.0.0.0:* LISTEN 23765/docker-proxy
tcp 0 0 0.0.0.0:8070 0.0.0.0:* LISTEN 23918/docker-proxy
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 23881/docker-proxy
tcp6 0 0 :::22 :::* LISTEN 915/sshd
tcp6 0 0 :::13306 :::* LISTEN 23770/docker-proxy
tcp6 0 0 :::8070 :::* LISTEN 23926/docker-proxy
tcp6 0 0 :::8080 :::* LISTEN 23890/docker-proxy
udp 0 0 172.16.252.2:68 0.0.0.0:* 901/NetworkManager
udp 0 0 127.0.0.1:323 0.0.0.0:* 835/chronyd
udp6 0 0 ::1:323 :::* 835/chronyd
#通过访问主机的8070端口进入apolli管理终端
用户名:apollo 密码admin
apollo服务后台管理页面 url:8080
mysqldb连接方式
主机ip地址
端口13306
用户名root
密码默认为空