Enterprise Developer ベース イメージの Docker デモンストレーションの Dockerfile (Enterprise Developer UNIX コンポーネント)

注: 本トピックは、Enterprise Developer UNIX コンポーネントを使用している場合にのみ該当します。

本トピックでは、Enterprise Developer ベース イメージの Docker デモンストレーションの Dockerfile で使用されるコマンドについて詳しく説明します。Dockerfile 全体をリストし、Dockerfile に含まれる各コマンドの説明をその後の表にまとめてあります。Dockerfile のリストに示してある行番号は、読みやすくするために追加したものです。付属の Dockerfile には記載されていません。

注: Red Hat Linux に付属の Dockerfile と SUSE Linux に付属の Dockerfile には多少の違いがあります。以下に示す Dockerfile は Red Hat Linux に付属のものです。2 つのバージョンの相違については次の表を参照してください。
001  # Copyright (C) Micro Focus 2018. All rights reserved. 
002  
003  FROM rhel7/rhel:latest
004  
005  # PRODUCT_VERSION is product version associated with this Dockerfile
006  # ACCEPTEULA is the build-arg name for the acceptance of the end user license agreement
007  # SETUP_EXE is the build-arg name name of installer to used
008  # COBSRV_LOC is the build-arg name for the installation location
009  # MFLICFILE is the build-arg name for the license filename
010  ARG PRODUCT_VERSION=4.0.00
011  ARG ACCEPTEULA
012  ARG SETUP_EXE=setup_entdev_for_docker_4.0_redhat_x64
013  ARG LOGFILE=EnterpriseDeveloper4.0.log
014  ARG MFLICFILE
015  ARG ESADM_UID=500
016  ARG ESADM_GID=500
017  ARG ESADM_USER=edadm
018  ARG ESADM_SHELL=/bin/bash
019  
020  LABEL vendor="Micro Focus" \
021        com.microfocus.name="Enterprise Developer" \
022        com.microfocus.version="$PRODUCT_VERSION" \
023        com.microfocus.eula.url="https://supportline.microfocus.com/licensing/agreements.aspx" \
024        com.microfocus.is-base-image="true"
025  
026  ENV MFPRODBASE=/opt/microfocus/EnterpriseDeveloper
027  ENV MFLICBASE=/var/microfocuslicensing
028  
029  
030  # install ed, pax and glibc-devel.x86_64 as these are a pre-req for the installer
031  # note: disablerepo is used to avoid "HTTPS Error 403 - Forbidden" error
032  RUN yum -y --disablerepo=rhel-7-server-rt-beta-rpms install ed pax gcc gcc-c++.x86_64 gdb glibc-devel.x86_64 make file
033  
034  # copy the installer from the local machine to the container
035  COPY ${SETUP_EXE} /tmp/
036  
037  # Create user esadm
038  RUN groupadd -f -g $ESADM_GID $ESADM_USER && \
039      useradd -u $ESADM_UID -g $ESADM_GID -m -s $ESADM_SHELL $ESADM_USER
040  
041  # ensure the setup exe has execute permissions and execute the setup
042  RUN chmod +x ./tmp/${SETUP_EXE} && \
043      (/tmp/${SETUP_EXE} -${ACCEPTEULA} -ESadminID=$ESADM_USER || (echo ${LOGFILE} contains && touch ${LOGFILE} && cat ${LOGFILE} && exit 1)) && \
044      rm -f /tmp/${SETUP_EXE} && \
045      echo "$MFPRODBASE/lib" >>/etc/ld.so.conf && \
046      ldconfig
047  
048  # install a license and remove the license file
049  COPY ${MFLICFILE} /tmp/
050  RUN cd /tmp && $MFLICBASE/bin/MFLicenseAdmin -install "${MFLICFILE}" && rm -f "${MFLICFILE}"
051  
052  # COPY cobsetenv_login to the bin
053  COPY cobsetenv_login /root/bin/
054  #
055  # clean up for containers that use -network:host
056  #
057  RUN  $MFLICBASE/bin/clean_guid_file

この Dockerfile の各行のコマンドは次のとおりです。

説明
003 使用するベース イメージを指定します。Red Hat の場合、Red Hat Enterprise Linux の公式 Docker イメージになります。

SUSE Linux の場合、この行は次のようになります。

FROM suse/sles12sp3

これにより、SUSE Linux Enterprise Server の公式 Docker イメージをベース イメージとして使用するように指定されます。

010 - 018 docker build コマンドで渡すビルド引数を定義します。
  • PRODUCT_VERSION。この Dockerfile が付属する Enterprise Developer のバージョンを示します。
  • SETUP.EXE。Enterprise Developer のインストール ファイルの名前を指定します。デフォルトの設定は、Enterprise Developer に付属のファイルの名前です。
  • ACCEPTEULA。Micro Focus エンドユーザライセンス契約 (EULA) の内容に同意したかどうかを示します。
  • LOGFILE。Enterprise Developer をイメージにインストールする際に作成されるログ ファイルの名前を指定します。
  • MFLICFILE。Enterprise Developer に使用するライセンス ファイルの名前を指定します。
  • ESADM_UID。Enterprise Server の管理者ユーザーに使用するユーザー ID を指定します。
  • ESADM_GID。Enterprise Server の管理者ユーザーに使用するグループ ID を指定します。
  • ESADM_USER。Enterprise Server の管理者ユーザーに使用する ID を指定します。
  • ESADM_SHELL。Enterprise Server の管理者ユーザーに使用するシェルを指定します。
020 - 024 作成するイメージのメタデータ ラベルを指定します。これらのラベルは docker inspect コマンドで照会できます。
026 - 027 この Dockerfile で使用する環境変数を作成します。
  • MFPRODBASE。Enterprise Developer のインストール先フォルダーを指定します。
  • MFLICBASE。Micro Focus License Administration ツールのインストール先フォルダーを指定します。
032 Enterprise Developer のインストールに必要なソフトウェアをインストールします。
035 Enterprise Developer のインストール ファイルを一時フォルダーにコピーします。
038 - 039 連結された一連のコマンドを実行して、Enterprise Server の管理者ユーザーを追加し、そのユーザーが使用するシェルを設定します。
042 - 046 連結された一連のコマンドを実行して、次の操作を実行します。
  1. Enterprise Developer のインストール ファイルを実行可能にします。
  2. Enterprise Developer のインストール ファイルを実行します。使用許諾契約書への同意を示すオプションと、System Administrator Process User ID を指定するオプションを使用します。
  3. 前に作成した一時フォルダー (Enterprise Developer のインストール ファイルが含まれているフォルダー) を削除します。
  4. 動的リンカーの実行時バインディングを構成して、Enterprise Developer に付属の共有オブジェクトを含めます。

    これにより、LD_LIBRARY_PATH 環境変数を更新する必要がなくなります。

049 - 050 ライセンス ファイルを一時的な場所にコピーして、Enterprise Developer のライセンスを有効にした後に削除します。
053 root としてログオンしたときに使用されるデフォルトの環境をコピーします。
057 Enterprise Developer のライセンスを適用する際に使用した一時ファイルをリセットするスクリプトを実行します。