(编辑:jimmy 日期: 2024/12/29 浏览:2)
1.首先下载mysql镜像和wordpress镜像
[root@kangvcar ~]# docker pull hub.c.163.com/library/mysql:latest [root@kangvcar ~]# docker pull hub.c.163.com/library/wordpress:latest
2.查看本地镜像列表
[root@kangvcar ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE hub.c.163.com/library/wordpress latest ca96afcfa242 4 weeks ago 405.7 MB hub.c.163.com/library/mysql latest 9e64176cd8a2 8 weeks ago 407.1 MB
3.用mysql镜像启动mysql容器
[root@kangvcar ~]# docker run --name mysql_wordpress -e MYSQL_ROOT_PASSWORD=000000 -d hub.c.163.com/library/mysql:latest 35f82ce4a617575356046439fd0dbb2cdc369c4332760d375774f0041bc93e64
4.用wordpress镜像启动wordpress容器,并link到上一步创建的mysql_wordpress容器
[root@kangvcar ~]# docker run --name wordpress --link mysql_wordpress:mysql_wordpress -p 80:80 -d hub.c.163.com/library/wordpress:latest 2b1b81df9749f637ff3ec8534489657cc8d39b54202e260fdef9195028e4ea08
5.访问
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。