Windows 用の Enterprise Developer ビルド ツールで使用するアプリケーションを含むイメージの作成

本トピックでは、Windows 用の Enterprise Developer ビルド ツールで実行できる COBOL アプリケーションを含むイメージを作成するために Dockerfile で実行する必要がある手順について説明します。

本トピックで説明しているプロセスは、Windows 用の Enterprise Developer ビルド ツールで使用できるアプリケーションのイメージを作成するための付属のコンテナー デモンストレーションで使用されているプロセスです。本トピックで説明している手順はコンテナー デモンストレーションの Dockerfile にすでに含まれているため、Micro Focus では、独自のアプリケーションを含むイメージを作成する必要がある場合、Dockerfile を新規に記述するのではなく、その Dockerfile をベースにすることをお勧めします。関連するすべてのファイルについての説明など、これらのコンテナー デモンストレーションの詳細については、「CICS コンテナー デモンストレーション」を参照してください。

注: COBOL アプリケーションをコンテナに移行するためのベスト プラクティス』という別のドキュメントが提供されており、ここでは Micro Focus が推奨するベスト プラクティスを紹介しています。これは、既存の COBOL アプリケーションを、コンテナー化された環境での実行に移行する際に適用するものです。詳細については、『Micro Focus: COBOL アプリケーションをコンテナに移行するためのベスト プラクティス』を参照してください。

このトピックの手順を実行する前に、Windows 用の Enterprise Developer ビルド ツールのベース イメージを作成しておく必要があります。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 ビルド ツールで使用するアプリケーションを含むイメージを作成する前に、次のものが用意されていることを確認する必要があります。

Windows 用の Enterprise Developer ビルド ツールで使用するアプリケーションを含むイメージを作成するには、Dockerfile で次の手順を実行する必要があります。

For users of Enterprise Developer for Eclipse:

  1. 作成元となるベース イメージを指定します。これは、必要に応じて 32 ビットまたは 64 ビット用に作成された Windows 用の Enterprise Developer ビルド ツールのみを含むイメージである必要があり、追加のビルド機能を含んでおり、通常は microfocus/edbuildtools-build:win_6.0_x86 または microfocus/edbuildtools-build:win_6.0_x64 になります。

    詳細については、「Windows 用の Enterprise Developer ビルド ツールを含むベース イメージの作成」を参照してください。

  2. Define metadata for your image. This will make it easier to establish significant details of the image when you use the docker inspect command.
  3. 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.

  4. アプリケーションのソース ファイルをイメージのファイルシステム上のフォルダーにコピーし、作業ディレクトリをそのフォルダーに設定します。
  5. アプリケーションのソース ファイルに対して行う必要があるすべての処理を実行します。通常これはコンパイルおよびビルドになりますが、Windows 用の Enterprise Developer ビルド ツールで可能な任意の処理を実行できます。
  6. ビルドしたアプリケーション ファイルをイメージのファイルシステム上にある目的のフォルダーにコピーし、作業ディレクトリをそのフォルダーに設定します。
  7. Micro Focus Directory Server (MFDS) が実行されるまで待ってから、必要なエンタープライズ サーバー リージョンを構成して起動します。これらの操作を実行するコマンド用に別のスクリプトを用意することを検討してください。CICS コンテナー デモンストレーションでは、DeployAndWait.ps1 というスクリプトを使用しています。
  8. Perform any required clean-up. This includes tasks such as resetting variables and deleting temporary folders.
  9. イメージの実行時に実行する実行可能ファイルの名前を指定します。

For users of Enterprise Developer UNIX Components:

  1. 作成元となるベース イメージを指定します。これは、Windows 用の Enterprise Developer ビルド ツールのみを含むイメージである必要があります。詳細については、「Windows 用の Enterprise Developer ビルド ツールを含むベース イメージの作成」を参照してください。
  2. アプリケーションの実行に使用する新しいユーザーを作成します。
  3. アプリケーション ファイル用のフォルダーを作成し、アプリケーション ファイルをそのフォルダーにコピーします。SUSE Linux を使用している場合は、所有権を変更して、新しいユーザーをこの新しいフォルダーの所有者として指定する必要があります。
  4. イメージの実行時に使用するユーザー名を指定します。
  5. イメージの実行時に実行する実行可能ファイルの名前を指定します。
  6. Micro Focus Directory Server (MFDS) を起動し、必要なエンタープライズ サーバー リージョンを構成して起動し、MFDS が実行されるまで待ちます。この手順で使用するコマンドの詳細とそれらの実行順序については、CICS コンテナー デモンストレーションの Dockerfile を確認してください。
注: You might also want to create an image that you can log in to and execute shell or Enterprise Developer commands. This option is useful if you are not adding any application files to a base image but want to be able to use Enterprise Developer commands from it.

All of the container demonstrations offer the option to create such a login image, and those images are tagged with the suffix "_login". See Running the Container Demonstration for the Enterprise Developer Base Image for information on how to specify that you want to create a _login image. For details on the commands required to build such an image, see the bld.sh script in any of the container demonstrations.

注: Windows 用の Enterprise Developer ビルド ツール で実行されるアプリケーションを含むコンテナーを起動する際、コンテナーのエンタープライズ サーバーをホスト マシン以外のマシンから Micro Focus Directory Server (MFDS) および Enterprise Server Monitor and Control (ESMAC) を使用して管理できるようにするには、docker run または podman run コマンドでいくつかの追加のパラメーターを指定する必要があります。追加のパラメーターは次のとおりです。
  • -p は、コンテナーのポートをホスト コンピューターのポートにマップします。
  • -e は、コンテナーが実行されているホスト コンピューターの名前を指定するための MFDS_EXTERNAL_ADDR 環境変数を指定します。

たとえば、CICS コンテナー デモンストレーションのイメージを実行する場合は、docker run または podman run コマンドで次のようにパラメーターを指定します。

-p 16001:86/udp -p16001:86/tcp -p 9000-9010:9000-9010 -e MFDS_EXTERNAL_ADDR=host-computer-name