最初のステップ:直接プルLAMPミラーミラー倉庫
[root@ken-node3 ken]# docker pull tutum/lamp
ステップ2:ミラーを確認してくださいが取得されています
[root@ken-node3 ken]# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
tutum/lamp latest 3d49e175ec00 3 years ago 427MB
第三ステップ:スタートコンテナ
[root@ken-node3 ken]# docker run -p 80:80 -p 3306:3306 -v /ken:/var/www/html -v /ken1:/var/lib/mysql -d tutum/lamp
コマンド解釈:
ポートマッピングのマシンは、マシンが占有されていないことを確認するために、ポート80、ポート80、ポート80に簡単です。
マシンがポート3306を占領されていないことを確認するための簡単なポート3306へのネイティブポートマッピングポート3306
データの永続性と管理を容易にするためにサイトコンテナのルートに機械/県ディレクトリのディレクトリマッピング
/ Ken1カタログ管理および持続性を容易にするために、データを有効にするために、本機のデータベース・ファイル・ディレクトリのコンテナにマッピングされ
バックグラウンドで実行中のコンテナ
ステップ4:次/ケン・ディレクトリ、およびデータベース・ユーザー名と編集にwordpressのインストールパッケージを準備します
[root@ken-node3 ken]# ls
wordpress wordpress-3.3.1-zh_CN.zip
[root@ken-node3 ken]# cp wordpress/* . -a
[root@ken-node3 ken]# ls index.php wordpress-3.3.1-zh_CN.zip wp-blog-header.php wp-cron.php wp-login.php wp-settings.php license.txt wp-activate.php wp-comments-post.php wp-includes wp-mail.php wp-signup.php readme.html wp-admin wp-config-sample.php wp-links-opml.php wp-pass.php wp-trackback.php wordpress wp-app.php wp-content wp-load.php wp-register.php xmlrpc.php [root@ken-node3 ken]# cp wp-config-sample.php wp-config.php [root@ken-node3 ken]# vim wp-config.php
ステップ5:適切なデータベースを入力して、簡単にユーザーを作成します
[root@ken-node3 ken]# docker exec -it 9dbad46eb3f2 bash
root@9dbad46eb3f2:/# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. 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 ken; Query OK, 1 row affected (0.00 sec) mysql> grant all on *.* to ken@'localhost' identified by '123'; Query OK, 0 rows affected (0.00 sec) mysql> grant all on *.* to ken@'%' identified by '123'; Query OK, 0 rows affected (0.01 sec) mysql> exit Bye
ステップ6:ブラウザアクセス
わずかに