1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

開発時の動作確認に、Dockerを利用してみたメモ

Posted at

dockerのバージョンは1.6.2。
phpプロジェクトのディレクトリ構成は以下。

+ ./
  + src/
    - index.php
  + conf/
    - php.ini
  + vendor/
  - composer.json
  - composer.lock
  - composer.phar

以下のコマンドで動作確認まで一気にできる。

$ brew install boot2docker
$ boot2docker init
$ boot2docker up
$ eval `boot2docker shellinit`
$ docker pull php:5.6-apache
$ docker run \
    --rm \
    --name php \
    -p 80:80 \
    -v `pwd`/src/:/var/www/html/ \
    -v `pwd`/vendor/:/var/www/html/vendor/ \
    -v `pwd`/conf/:/usr/local/etc/php/ \
    php:5.6-apache

後は boot2docker ip に対して、ブラウザからアクセスすればOK。
公式イメージはとてもありがたいですね。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?