zoukankan      html  css  js  c++  java
  • 【Vegas原创】Docker安装最新版wordpress

    0.安装docker

    curl -fsSL https://get.docker.com | bash -s docker --mirror aliyun
    service docker start


    1. docker pull最新版的wordpress

    docker pull wordpress

    image


    2.docker 安装mysql

    [root@3 ~]# docker pull mysql
    image


    3. 配置mysql

    docker run -d --privileged=true --name mysql -v /data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=vegasd -p 3306:3306 mysql

    image


    4.启动wordpress

    docker run -d --name wordpress -e WORDPRESS_DB_HOST=mysql -e WORDPRESS_DB_USER=root -e WORDPRESS_DB_PASSWORD=vegasd -e WORDPRESS_DB_NAME=wp -p 81:80 --link mysql:mysql wordpress

    image

    -p: 这里是指定 WordPress 容器的访问端口
    --link: 意思是将 mysql容器挂载到 mysql,这样 WordPress 就能通过 mysql 访问到docker中的数据库了

    wp:数据库名


    5.进入mysql的bash,创建wp数据库

    [root@3 ~]# docker exec -it mysql bash
    root@b310463fd2a5:/# mysql -uroot -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 34
    Server version: 8.0.25 MySQL Community Server - GPL
    
    Copyright (c) 2000, 2021, Oracle and/or its affiliates.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql> create database wp;
    Query OK, 1 row affected (0.01 sec)
    
    mysql> exit
    Bye
    root@b310463fd2a5:/#


    6,访问 http://ip:81 开始愉快的玩耍。

    image

    喜欢请赞赏一下啦^_^
  • 相关阅读:
    UML类图与类的关系详解
    UML用例图总结
    jQuery随机抽取数字号代码
    贪心算法
    回溯法实例详解(转)
    React 表单元素实例
    React 组件嵌套 父子关系
    React 滚动事件
    error: Error trying to parse settings: Unexpected trailing characters in PackagesUserPreferences.sublime-settings:9:2 reloading settings Packages/User/Preferences.sublime-settings
    jquery 下拉框左右选择
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/14837085.html
Copyright © 2011-2022 走看看