This topic lists and describes the Dockerfile.x64 file from the Docker demonstration for the Visual COBOL base image.Dockerfile 全体をリストし、Dockerfile に含まれる各コマンドの説明をその後の表にまとめてあります。Dockerfile のリストに示してある行番号は、読みやすくするために追加したものです。付属の Dockerfile には記載されていません。
001 # Copyright (C) Micro Focus 2018. All rights reserved.
002
003 ARG DTAGVER=
004 ARG BASE_SUFFIX=
005 FROM microfocus/vcbuildtools${BASE_SUFFIX}:${DTAGVER}
006
007 # copy the powershell script to convert cblpromp -J output to setx command
008 ADD convsetx.ps1 "c:\convsetx.ps1"
009
010 # ensure msbuild is always on the PATH
011 RUN setx /M PATH "%PATH%;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319"
012
013 # convert the output of cblprompt into SETX commands and execute them
014 RUN cd %TOOLS_LOC% && \
015 bin64\cblpromp.exe -J >env.prop && \
016 powershell -file "c:\convsetx.ps1" >envsetx.bat && \
017 envsetx.bat && \
018 del envsetx.bat && \
019 del env.prop && \
020 del "c:\convsetx.ps1"
The commands on the lines in this Dockerfile are as follows:
| 行 | 説明 |
|---|---|
| 003 - 004 | docker build コマンドで渡すビルド引数を定義します。 |
| 005 | Dockerfile から作成されたイメージをベース イメージとして使用するように指定します。 |
| 008 | convsetx.ps1 PowerShell スクリプトをイメージのファイルシステムにコピーします。 |
| 011 | PATH 環境変数を更新して、MSBuild を使用できるようにします。 |
| 014 - 020 | 連結された一連の Windows コマンドを実行して、COBOL コマンド プロンプトで設定されたすべての環境変数をこのイメージ内のアプリケーションで使用できるようにします。 |