LoginSignup
5
2

More than 5 years have passed since last update.

Dockerでnginxおためし環境を作る

Posted at

前提条件

  • mac
  • Dockerアプリがインストール済であること
    (インストール方法はこちらをご参照ください)

手順

nginxのdockerイメージを取得

$ docker pull nginx

# 確認
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              5699ececb21c        6 days ago          109MB

コンテナの起動

$ docker run -d -p 8081:80 nginx
※"8081"は任意の空いているポート

オプション

  • -d バックグラウンド実行
  • -p ホストのポート:コンテナのポート

アクセス

http://localhost:8081
スクリーンショット 2018-07-03 22.44.26.png

次回以降は下記についてまとめる予定です。
- Dockerfileを利用して、confファイルを反映
- nginxの基本的なconf設定おためし

5
2
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
5
2