LoginSignup
16
9

More than 5 years have passed since last update.

dockerコンテナへのアクセス

Last updated at Posted at 2018-01-10

前回の記事ではdocker上でnginxが起動するまでを行いました。
今回は、dockerコンテナへアクセスしてnginxの設定ファイルを探します。

dockerコンテナのプロセス確認

$ docker ps

testserverという名前のnginxイメージが起動しています。
1__Thanks_for_flying_Vim__zsh_.jpg

コンテナにアクセス

$ docker exec -it testserver /bin/bash

スクリーンショット 2018-01-11 23.26.58.png

nginxの設定ファイル

公式ドキュメントには
「It is typically one of /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx .」
とあり、Google翻訳すると
「通常は /usr/local/nginx/confか/etc/nginx//usr/local/etc/nginx/ にあります。」
とのことです。
参照 https://www.nginx.com/resources/admin-guide/configuration-files/

/etc/nginx
1__Thanks_for_flying_Vim__docker_.jpg

nginx.conf
スクリーンショット 2018-02-06 0.32.51.png

実際はコンテナ内に入る機会はそんなにないようですが、
緊急時や直接確認したい事があるかもしれませんので、覚えていて損はないでしょう。

16
9
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
16
9