Skip to content

Instantly share code, notes, and snippets.

@utahta
Created May 31, 2017 04:52
Show Gist options
  • Save utahta/0a30db38d601ed2f9487a169352df45e to your computer and use it in GitHub Desktop.
Save utahta/0a30db38d601ed2f9487a169352df45e to your computer and use it in GitHub Desktop.

Docker で PHP 5.2 をインストールして動かすメモ

利用したコンテナ

tommylau/php-5.2 tommylau/nginx mysql

Pull

docker pull tommylau/php-5.2
docker pull tommylau/nginx
docker pull mysql:5.6

Run

docker run --rm --name mysql5.6 -e MYSQL_ROOT_PASSWORD=password -d mysql:5.6
docker run --rm --name php -v /path/to/web:/var/www/html --link mysql5.6:mysql -d tommylau/php-5.2
docker run --rm --name nginx -v /path/to/web:/var/www/html --link php:php -p 9000:80 -d tommylau/nginx

確認

cat /path/to/web/index.php
<?php
echo phpinfo();

open http://localhost:9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment