本トピックでは、Windows 用の Enterprise Developer ビルド ツール ベース イメージを作成するために Dockerfile で実行する必要がある手順について説明します。
Windows 用の Enterprise Developer ビルド ツール ベース イメージを作成する最も簡単で推奨される方法は、「Enterprise Developer ベース イメージのコンテナー デモンストレーション」の説明に従ってコンテナー デモンストレーションを使用する方法です。コンテナー デモンストレーションを使用する場合は、すべての手順がコンテナー デモンストレーションで実行されるため、本トピックで説明する手順を実行する必要はありません。本トピックでは、Windows 用の Enterprise Developer ビルド ツール ベース イメージを作成するための独自の Dockerfile を記述する手順を示しています。
注: 『COBOL アプリケーションをコンテナに移行するためのベスト プラクティス』という別のドキュメントが提供されており、ここでは Micro Focus が推奨するベスト プラクティスを紹介しています。これは、既存の COBOL アプリケーションを、コンテナー化された環境での実行に移行する際に適用するものです。詳細については、『Micro Focus: COBOL アプリケーションをコンテナに移行するためのベスト プラクティス』を参照してください。
Windows 用の Enterprise Developer ビルド ツール ベース イメージを作成した後、そのベース イメージに基づいて、COBOL アプリケーションおよび Windows 用の Enterprise Developer ビルド ツール を含む追加イメージを作成できます。この追加イメージの作成の詳細については、「Windows 用の Enterprise Developer ビルド ツール で使用するアプリケーションを含むイメージの作成」を参照してください。
注: Remember that
Enterprise Developer is a development and test environment so not for use in production situations. If you want to run COBOL applications in containers in a production environment you must use containers that contain
Enterprise Server.
Windows 用の Enterprise Developer ビルド ツール ベース イメージを作成する前に、次のものが用意されていることを確認する必要があります。
- The installable executable file for
Windows 用の Enterprise Developer ビルド ツール. This is
edbt_60.exe and is supplied in the container demonstration for the
Windows 用の Enterprise Developer ビルド ツール base image.
- The appropriate license (.mflic) file for
Windows 用の Enterprise Developer ビルド ツール.
- If you will be including Java support in the image, the relevant executable file to perform the installation of the JDK. You can get this file from your chosen JDK provider.
Windows 用の Enterprise Developer ビルド ツール を含むベース イメージを作成するには、Dockerfile で次の手順を実行する必要があります。
- 作成元となるベース イメージを指定します。通常、これは microsoft/dotnet-framework または microsoft/dotnet-framework-build になります。
Windows 用の Enterprise Developer ビルド ツール を含むベース イメージを作成する場合は、通常のイメージ (microsoft/dotnet-framework から作成) および「-build」イメージ (microsoft/dotnet-framework-build から作成) の 2 種類のイメージを必要に応じて作成できます。microsoft/dotnet-framework-build イメージには、microsoft/dotnet-framework に含まれていないビルド関連のファイルが含まれています。つまり、microsoft/dotnet-framework から作成されたイメージではアプリケーションを実行できますが、アプリケーションをビルドする場合には、microsoft/dotnet-framework-build を使用する必要があります。
注: microsoft/dotnet-framework-build には
microsoft/dotnet-framework に含まれていない追加ファイルが含まれているため、追加のビルド関連機能が必要な場合は、コンテナーのサイズを最小限に抑えるために、
microsoft/dotnet-framework-build のみを使用してください。
Windows 用の Enterprise Developer ビルド ツール を含むベース イメージを作成するコンテナー デモンストレーションでは、この方法を使用して、microfocus/edbuildtools:win_6.0 と microfocus/edbuildtools-build:win_6.0 の両方を作成します。
- Define metadata for your image. This will make it easier to establish significant details of the image when you use the
docker inspect command.
- Define any variables for filenames and folder locations.
注: If you will be using this image to run applications under Enterprise Server, you need to set the MFDS_EXTERNAL_ADDR environment variable to specify a resolvable external address string. This is to enable client browsers to resolve the URLs used by ESMAC and other utilities in Enterprise Server Administration.
The value that you specify for this environment variable is used to replace the internal container address in the URL.
- Windows 用の Enterprise Developer ビルド ツール (edbt_60.exe) のインストール可能な実行可能ファイルをホスト マシンからイメージのファイルシステム内の一時フォルダーにコピーし、そのファイルを実行して、Windows 用の Enterprise Developer ビルド ツールをインストールします。
edbt_60.exe の実行時、次のパラメーターを指定する必要があります。
- /q
- サイレント インストールを実行します。これはユーザー インターフェイスを使用しない非対話型の方法であり、コマンド ラインで別途指定されていない限り、すべての値にデフォルト値が使用されます。
- InstallFolder=installation-location
- Windows 用の Enterprise Developer ビルド ツール をインストールするフォルダーの名前を指定します。このフォルダーは、イメージのファイルシステム上に作成しておく必要があります。
- /l log-file-name
- インストールのログ ファイルを作成します。
- accepteula=yes
- Micro Focus エンドユーザー使用許諾契約書 (EULA) の内容に同意することを示します。
- インストール時に生成されたログ ファイルを調べて、インストールが正常に完了したことを確認します。
- MFLicenseAdmin.exe ユーティリティを使用して、Windows 用の Enterprise Developer ビルド ツールのライセンスをインストールします。
- Ant および Java のサポートを設定します。
- 実行時にコンテナーがリッスンするネットワーク ポートを指定します。
- Perform any required clean-up. This includes tasks such as resetting variables and deleting temporary folders.
- 作業ディレクトリをWindows 用の Enterprise Developer ビルド ツール のインストール先フォルダーに設定します。
注: 上記の手順を実行する Dockerfile に加えて、
Windows 用の Enterprise Developer ビルド ツール ベース イメージのプラットフォーム固有のバージョンを作成する追加の Dockerfile を用意することをお勧めします。追加の Dockerfile は非常に単純で、
Windows 用の Enterprise Developer ビルド ツール ベース イメージを基礎として使用して、正しい (32 ビットまたは 64 ビット) 環境が設定されていることを確認するコマンドを実行するだけです。
また、Java のサポートを含まない Windows 用の Enterprise Developer ビルド ツール ベース イメージを作成することもできます。この必要がある場合は、Java のサポートを設定するためのステップを実行しないように上記の手順を変更するだけです。
Windows 用の Enterprise Developer ビルド ツール ベース イメージを作成する場合に、.NET COBOL アプリケーションをデバッグできるようにするには、必要なサポート ファイルがイメージに含まれていることを確認する必要があります。詳細については、「コンテナーで実行される .NET COBOL アプリケーションのデバッグ」を参照してください。