第一步:删除容器镜像文件
[root@localhost ~]# docker rm -f `docker ps -aq`
b09ee6438986
e0fe8ebf3ba1
第二步:使用docker拉取数据库
[root@localhost ~]# docker run -d --name db mysql:5.7
02a4e5bfffdc81cb6403985fe4cd6acb0c5fab0b19edf9f5b827478346e1d026
第三步:搜索使用率最高的镜像引擎
[root@localhost ~]# docker search discuz
NAME DESCRIPTION STARS OFFICIAL
vulhub/discuz 0
tencentci/discuz 每月或周构建腾讯旗下最新Discuz3.5+,并同步更… 33
discuzamoy/jd 1
discuzamoy/jd_scripts discuzamoy/jd_scripts:latest 0
locoz666666/discuz-x Discuz X 容器镜像每日自动构建(基于官方Gitee… 1
y109/discuz The most popular BBS programe in PHP. (http:… 13
vulfocus/discuz-wooyun_2010_080723 用户名密码:admin:admin 0
cloud96/discuz 基于Docker技术,一键安装 Discuz 最新版(X3.4)… 5
websoft9dev/discuzq DiscuzQ from Tencent image 1
urlos/discuz-sc-utf8 0
nvidiacn/discuz 0
p8361/discuz-ssrf discuz-ssrf 0
urlos/discuzq-env 0
v7lin/discuz discuz 0
vulfocus/discuzml-cve_2019_13956 0
boyhack/discuz_ml discuz_ml rce 靶机 0
langyo/discuz_x2 Discuz X2 论坛引擎镜像,开箱即用 0
dockeradminnet/discuz-sc-utf8 0
discuz/dzq 包含数据库的dzq镜像 0
astate/discuz-zh 基於Discuz! X3.2 Release 20151208繁中UTF-8的… 1
richiemay/discuz discuz安装完成后,下次重启容器会自动改名inst… 0
bachang/discuz2.5 discuz2.5 0
ttt123shilin/discuz 采用php-fpm+nginx的方式部署了discuz项目 0
lycclsltt/discuz discuz enviroment, include mysql, php, nginx 0
discuz/dzq-no-db 不包含数据库的dzq镜像 0
第四步:创建容器db,查看容器
[root@localhost ~]# docker run -d --name db -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
1f47a4c46796441e238d22250cbd86f90a687ca6f1dd6f5fa11ed5ec54d16a38
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1f47a4c46796 mysql:5.7 "docker-entrypoint.s…" 11 seconds ago Up 9 seconds 3306/tcp, 33060/tcp db
第五步:创建容器BBS,查看容器
[root@localhost ~]# docker run -d --name bbs --link db:db -p 80:80 tencentci/discuz 01776eb7a064bc7de1818b0345b4105d6812d698a4fda12e295e58dbb5aee474
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
01776eb7a064 tencentci/discuz "docker-php-entrypoi…" About a minute ago Up About a minute 0.0.0.0:80->80/tcp, 443/tcp bbs
1f47a4c46796 mysql:5.7 "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 3306/tcp, 33060/tcp db
第六步:使用主机IP地址到浏览器搜索,填写数据库和管理员信息,完成安装
第七步:使用wordpress替代 discuz搭建论坛
[root@localhost ~]# docker run -d --name blog --link db:db -p 8080:80 wordpress
Unable to find image 'wordpress:latest' locally
latest: Pulling from library/wordpress
e1caac4eb9d2: Pull complete
8c386db9cb1d: Pull complete
bef1b237c949: Pull complete
56c66cb68b0f: Pull complete
9c790c1c009d: Pull complete
e055748d0b38: Pull complete
5a9d72b3b895: Pull complete
98b90bb43484: Pull complete
b0a0159e983e: Pull complete
4a03c0d0f683: Pull complete
5cb1486f0b5a: Pull complete
370828abc98a: Pull complete
a789e0a12acd: Pull complete
30b6bf5f6eeb: Pull complete
cc0d5481a137: Pull complete
f8966f941a57: Pull complete
83483f29ea4d: Pull complete
371dfab62a96: Pull complete
3f4af3e34785: Pull complete
ad3725d6d7c1: Pull complete
82c78f0e7ebc: Pull complete
Digest: sha256:9acb6958caf4d95ffa4632a2b8d1de41e7c0286b0f94c2d4b74ce6e09a3fd5cb
Status: Downloaded newer image for wordpress:latest
cf4da6990049382ffa798543bad405a77bc8ea34afda887d1bd80cf3bf657cdb
第八步:使用主机IP地址到浏览器搜索,输入所需信息搭建完成