本トピックでは、CICS Docker デモンストレーションの Dockerfile で使用されるコマンドについて詳しく説明します。Dockerfile 全体をリストし、Dockerfile に含まれる各コマンドの説明をその後の表にまとめてあります。Dockerfile のリストに示してある行番号は、読みやすくするために追加したものです。付属の Dockerfile には記載されていません。
001 # Copyright (C) Micro Focus 2018. All rights reserved.
002 # This sample code is supplied for demonstration purposes only
003 # on an "as is" basis and is for use at your own risk.
004
005 ARG EDBTTAG
006 FROM microfocus/edbuildtools:${EDBTTAG}
007
008 LABEL com.microfocus.is-example="true"
009
010 # required arguments
011 ARG EDBTPLATFORM
012
013 # optional arguments
014 ARG APPDIR=c:\\app
015
016 # copy the application to the application directory
017 ENV BASE "${APPDIR}\\MSS"
018 COPY MSS${EDBTPLATFORM}_export.zip "${APPDIR}\\MSS_export.zip"
019 COPY MSS "${APPDIR}\\MSS\\"
020
021 # set the start directory and the initial program name
022 WORKDIR "${APPDIR}"
023
024 RUN set APPDIR=${APPDIR} && \
025 powershell -Command "Expand-Archive MSS_export.zip -Force -DestinationPath %APPDIR%" && \
026 del MSS_export.zip
027
028 WORKDIR "${APPDIR}\\MSS${EDBTPLATFORM}"
029
030 ENV EDBTPLATFORM=${EDBTPLATFORM}
031
032 CMD ["powershell", "-file", "..\\MSS\\DeployAndWait.ps1", "-es_name", "MSS$($env:EDBTPLATFORM))"]
033
034 EXPOSE 86 443 500-55000
The commands on the lines in this Dockerfile are as follows:
| 行 | 説明 |
|---|---|
| 005 - 006 | 使用するベース イメージとして、Windows 用の Enterprise Developer ビルド ツール ベース イメージを指定します。 |
| 008 | 作成するイメージのメタデータ ラベルを指定します。これらのラベルは docker inspect コマンドで照会できます。 |
| 011 - 014 | docker build コマンドで渡すビルド引数を定義します。
|
| 017 - 019 | Copy the .zip files containing the CICS application source files to the relevant folders in the image's filesystem. |
| 022 | Sets the Docker working directory to be the directory containing the CICS application. |
| 024 - 026 | Runs a series of concatenated Windows commands to unzip the CICS application source files to the relevant folders in the image's filesystem then delete the .zip files. |
| 028 | Sets the Docker working directory to be the platform-specific folder into which you unzipped the CICS application source files. |
| 030 | Creates an environment variable to hold a value that indicates whether the CICS application will be running in a 32-bit or 64-bit environment. |
| 032 | Runs a PowerShell script to start the Micro Focus Directory Server (MFDS), deploy the region definitions, then application and display the console .log file for the region until the container is terminated. |
| 034 | 実行時にコンテナーがリッスンするネットワーク ポートを指定します。 |