如何通过docker方式部署自动化运维平台

步骤一:拉取镜像并查看镜像

root@centos7:~# docker pull registry.aliyuncs.com/openspug/spug
Using default tag: latest
latest: Pulling from openspug/spug
2d473b07cdd5: Pull complete 
c8d7ce97cf0d: Pull complete 
74385da70ad4: Pull complete 
c83424c7db01: Pull complete 
b9e4cd5125ea: Pull complete 
0a8010b22945: Pull complete 
d2ddbe38d832: Pull complete 
55fb0785886b: Pull complete 
64026e87ca92: Pull complete 
353c6a7e4ce5: Pull complete 
9cb5f175562f: Pull complete 
67aa9bc0870f: Pull complete 
7918f2774cc6: Pull complete 
5b3c63fdc7b2: Pull complete 
Digest: sha256:4ef7a69a2aebc21f255d8ee7e59ab246eb40613666a9f1b6d512406495c37180
Status: Downloaded newer image for registry.aliyuncs.com/openspug/spug:latest
registry.aliyuncs.com/openspug/spug:latest

root@centos7:~# docker images
REPOSITORY                            TAG                   IMAGE ID       CREATED        SIZE
nginx                                 latest                e4720093a3c1   12 days ago    187MB
registry.aliyuncs.com/openspug/spug   latest                09ad35a1fe69   3 months ago   702MB
wordpress                             5.8.0-php8.0-apache   30b91ab1b536   2 years ago    620MB
mysql                                 5.7.30                9cfcce23593a   3 years ago    448MB
 

步骤二:运行容器并进行持久化

root@centos7:~# docker run -d --restart=always --name=spug -p 80:80 -v /mydata/:/data registry.aliyuncs.com/openspug/spug
bfd81a4ecb086026d98bdfc86dfd3ce75daa2c0600968dc6cf3d513c8bb3a696

root@centos7:~# docker ps
CONTAINER ID   IMAGE                                 COMMAND            CREATED         STATUS         PORTS                               NAMES
bfd81a4ecb08   registry.aliyuncs.com/openspug/spug   "/entrypoint.sh"   3 seconds ago   Up 2 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp   spug
 

步骤三:进行初始化

root@centos7:~# docker exec spug init_spug admin 123456
/usr/local/lib/python3.6/site-packages/OpenSSL/_util.py:6: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
  from cryptography.hazmat.bindings.openssl.binding import Binding
Migrations for 'account':
 

Running migrations:
  Applying account.0001_initial... OK
  Applying alarm.0001_initial... OK
  Applying config.0001_initial... OK
  Applying app.0001_initial... OK
  Applying repository.0001_initial... OK
  Applying deploy.0001_initial... OK
  Applying exec.0001_initial... OK
  Applying home.0001_initial... OK
  Applying host.0001_initial... OK
  Applying monitor.0001_initial... OK
  Applying notify.0001_initial... OK
  Applying schedule.0001_initial... OK
  Applying setting.0001_initial... OK
初始化/更新成功
/usr/local/lib/python3.6/site-packages/OpenSSL/_util.py:6: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
  from cryptography.hazmat.bindings.openssl.binding import Binding
创建用户成功
 

步骤四:通过本地服务器IP地址访问即可

  • 23
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值