本トピックでは、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 FROM microfocus/entdevhub:rhel7_4.0_x64 006 007 ARG ESADM_USER=edadm 008 009 LABEL com.microfocus.is-base-image="false" 010 011 # Create user app and setup cobsetenv 012 USER root 013 014 RUN useradd -ms /bin/bash app && \ 015 usermod -aG $ESADM_USER app && \ 016 touch /etc/profile && \ 017 touch ~app/.bashrc && \ 018 echo ". ~/bin/cobsetenv_login" >>~app/.bashrc && \ 019 echo ". ~/bin/cobsetenv_login" >>~app/.bash_login 020 021 COPY sample_setup /home/app/bin/ 022 RUN chown -R app /home/app 023 024 USER app 025 ENV BASE /home/app/MSS 026 ENV CCITCP2_PORT 4790 027 WORKDIR "/home/app" 028 COPY MSS.tar.gz /home/app 029 COPY MSS64_export.tar.gz /home/app 030 RUN tar xvfp MSS.tar.gz && \ 031 tar xvfp MSS64_export.tar.gz 032 033 COPY cobsetenv_login /home/app/bin/ 034 035 EXPOSE 443 500-55000 036 037 CMD /home/app/bin/sample_setup
The commands on the lines in this Dockerfile are as follows:
Lines | Description |
---|---|
005 | Specifies the base image to use, which is the
Enterprise Developer base image.
SUSE Linux では、Dockerfile で指定されるタグは sles12sp3_4.0_x64 になります。 |
007 | docker build コマンドで渡すビルド引数を定義します。
|
009 | 作成するイメージのメタデータ ラベルを指定します。これらのラベルは docker inspect コマンドで照会できます。 |
012 | Sets the user to root. |
014 - 022 | 連結された一連のコマンドを実行して、Enterprise Server の管理者ユーザーを追加し、そのユーザーが使用するシェルを設定します。 |
024 | Sets the user name to be used when running the image. |
025 - 026 | この Dockerfile で使用する環境変数を作成します。
|
027 | Sets the Docker working directory to be the folder where the CICS application source files are located. |
028 - 031 | Copy the .tar files containing the CICS application source files then extract the source files from them. |
033 | Copy the default environment that is to be used when someone logs on . |
035 | 実行時にコンテナーがリッスンするネットワーク ポートを指定します。 |
037 | Runs a 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. |