質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Q&A

解決済

1回答

553閲覧

Dockerコンテナ内でのviの挙動がおかしい

退会済みユーザー

退会済みユーザー

総合スコア0

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

0グッド

0クリップ

投稿2018/10/02 06:24

編集2018/10/02 06:35

DockerでシンプルにApacheをインストールしたコンテナを作成しました。

DockerFile

1FROM centos 2 3LABEL title="TestApacheImage"\ 4 version="1.0"\ 5 description="test apache" 6 7RUN ["rpm", "--import", "/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7"] 8RUN ["yum", "-y", "install","httpd"] 9 10EXPOSE 80 11 12CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]

これを以下のコマンドで起動します。

#ビルド docker image build -t apache -f DockerFile . #run(viで開いたとき変な折り返しをしていたので環境変数いじってます) docker container run -it -p 8080:80 -e COLUMNS=$COLUMNS -e LINES=$LINES -e TERM=$TERM apach

するとこのようなエラーが出たので

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message

ServerNameを編集するために、/etc/httpd/conf/httpd.conf をviで開いてみました。

httpd.conf

1# 2# This is the main Apache HTTP server configuration file. It contains the 3# configuration directives that give the server its instructions. 4# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. 5# In particular, see 6# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> 7# for a discussion of each configuration directive. 8# 9# Do NOT simply read the instructions in here without understanding 10# what they do. They're here only as hints or reminders. If you are unsure 11# consult the online docs. You have been warned. 12# 13# Configuration and logfile names: If the filenames you specify for many 14# of the server's control files begin with "/" (or "drive:/" for Win32), the 15# server will use that explicit path. If the filenames do *not* begin 16# with "/", the value of ServerRoot is prepended -- so 'log/access_log' 17# with ServerRoot set to '/www' will be interpreted by the 18# server as '/www/log/access_log', where as '/log/access_log' will be 19# interpreted as '/log/access_log'. 20 21# 22# ServerRoot: The top of the directory tree under which the server's 23# configuration, error, and log files are kept. 24# 25# Do not add a slash at the end of the directory path. If you point 26# ServerRoot at a non-local disk, be sure to specify a local disk on the 27# Mutex directive, if file-based mutexes are used. If you wish to share the 28# same ServerRoot for multiple httpd daemons, you will need to change at 29# least PidFile. 30# 31ServerRoot "/etc/httpd" 32 33# 34# Listen: Allows you to bind Apache to specific IP addresses and/or 35# ports, instead of the default. See also the <VirtualHost> 36# directive. 37# 38# Change this to Listen on specific IP addresses as shown below to 39# prevent Apache from glomming onto all bound IP addresses. 40# 41"/etc/httpd/conf/httpd.conf" 353L, 11753C

するとこのように表示されたのですが、これより先がまったく表示されません。本来この下にServerNameの設定する部分があったと思うのですが、なぜ表示されないのでしょうか?

【追記】
ちなみにDockerはVagrantで立ち上げたLinuxで行っています。git bushで vagrant ssh しているのですが、その辺も関係あるのでしょうか・・

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

otn

2018/10/02 06:30

スクロールしようとすると、どういう現象になりますか?
退会済みユーザー

退会済みユーザー

2018/10/02 06:32

普通にスクロールできます。ただスクロール先にはなにも書かれていません・・
guest

回答1

0

ベストアンサー

GitBashでvagrant upした後、TeraTermでプライベートipでsshし、改めてDockerをやってみたところ、全文表示されました。まさかのターミナルの問題・・・。なぜGitBashで表示されなかったのかは不明です。

投稿2018/10/02 07:00

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問