試験305-300J トピック1 問題55 スレッド
Lpi 305-300Jのリアル試験問題集
問題 #: 55
トピック #: 1
問題 #: 55
トピック #: 1
Dockerfile に次の行が含まれているとします。
作業ディレクトリ /
実行 cd /tmp
RUN エコーテスト > テスト
ファイルtestはどこにありますか?
作業ディレクトリ /
実行 cd /tmp
RUN エコーテスト > テスト
ファイルtestはどこにありますか?
おすすめの解答:C 解答を投票する
The WORKDIR instruction sets the working directory for any subsequent RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile1. The RUN instruction executes commands in a new layer on top of the current image and commits the results2. The RUN cd command does not change the working directory for the next RUN instruction, because each RUN command runs in a new shell and a new environment3. Therefore, the file test is created in the root directory (/) of the container image, not in the /tmp directory. References:
* Dockerfile reference: WORKDIR
* Dockerfile reference: RUN
* difference between RUN cd and WORKDIR in Dockerfile
* Dockerfile reference: WORKDIR
* Dockerfile reference: RUN
* difference between RUN cd and WORKDIR in Dockerfile
安西** 2024-05-07 12:04:03
コメント
他人の解答コメントを賛成するのも、その解答に一票を入れることになります。したがって、すでに同じ意見の投票コメントが存在する場合、新規コメントをする代わりに賛成することもできます。
コメントを通報する
コメント中
今すぐ 新規登録 / ログイン (無料です)。