LoginSignup
0
0

More than 5 years have passed since last update.

php -S するだけの小さな Docker イメージ

Last updated at Posted at 2017-04-15

テストように、サーブするイメージを使いたくて、書きました。

Dockerfile
FROM php:7
WORKDIR /myapp
ADD index.php /myapp/index.php
CMD php -S 0.0.0.0:7788

上で、CMD php -S localhost:7788 と書いてしばらくハマっておりました。 😓

index.php
<html>
  <body>
    kuririn
  </body>
</html>

$ tree
.
├── Dockerfile
└── index.php

いかのコマンドを叩くと localhost:7766 でアクセスができるようになります。

Command
$ docker build --tag php-sample .
$ docker run -d -p 7766:7788 php-sample

以上です。😬

スクリーンショット 2017-04-15 15.20.40.png

0
0
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
0
0