ページの先頭行へ戻る
Interstage Application Server V12.2.0 Red Hat OpenShift上での利用手順書
FUJITSU Software

A.3.1 Dockerfile

CORBAサービスベアイメージ作成時に使用するDockerfileの定義内容を以下の図に記載します。

なお、以下の図は、ベースイメージにregistry.access.redhat.com/rhel7.3を使用する例です。赤字の部分は環境に合わせて修正してください。

CORBAサービスでCOBOLアプリケーションを使用する場合は、NetCOBOLインストール済みのDockerイメージ(COBOL開発資産未配備のベアイメージ)をDockerfileのbase imangeに指定してください。NetCOBOL環境の構築方法は、NetCOBOL Enterprise Editionのマニュアルを参照してください。

# Get Base image
FROM registry.access.redhat.com/rhel7.3

# Create directories
RUN mkdir /work /interstage

# Copy Interstage install DVD to the docker image
COPY ./iaps /work/iaps

# Copy parameter csv file to the docker image
COPY ./corba.csv /work/corba.csv

# Copy shell scripts to the docker image
COPY ./interstage /interstage
RUN chmod 0544 /interstage/backup_restore/* /interstage/probe/*

# set SELinux
RUN /bin/mkdir -p /etc/selinux/targeted/contexts/;         \
    /bin/echo '<busconfig><selinux></selinux></busconfig>' \
    > /etc/selinux/targeted/contexts/dbus_contexts

# set Locale
ARG install_langs="ja_JP.utf8"
ARG lang_env="ja_JP.UTF-8"
RUN /bin/sed -i -e "/^override_install_langs/s/$/,${install_langs}/g" \
    /etc/yum.conf;                                                          \
    /bin/sed -i -e "s/^LANG=.*/LANG=${lang_env}/g" /etc/locale.conf;   \
    /bin/yum -y reinstall glibc-common
ENV LANG=${lang_env} LANGUAGE="${lang_env}" LC_ALL="${lang_env}"

# set TimeZone
ARG timezone="Asia/Tokyo"
RUN /bin/yum -y reinstall tzdata; \
    /bin/ln -snf /usr/share/zoneinfo/${timezone} /etc/localtime

# set up Systemd
ENV container docker
RUN /bin/yum -y swap -- remove fakesystemd -- install             \
    systemd systemd-libs;                                            \
    /bin/ls -d /lib/systemd/system/sysinit.target.wants/* |       \
    /bin/grep -v "systemd-tmpfiles-setup.service" |                \
    /bin/xargs /bin/rm -f;                                           \
    /bin/rm -f /etc/systemd/system/*.wants/*                       \
               /lib/systemd/system/anaconda.target.wants/*         \
               /lib/systemd/system/basic.target.wants/*            \
               /lib/systemd/system/local-fs.target.wants/*         \
               /lib/systemd/system/multi-user.target.wants/*       \
               /lib/systemd/system/sockets.target.wants/*initctl* \
               /lib/systemd/system/sockets.target.wants/*udev*

# set up Syslogd
RUN /bin/yum install -y rsyslog; \
    /bin/sed 's/$ModLoad imjournal/# $ModLoad imjournal/'     \
              -i /etc/rsyslog.conf;                              \
    /bin/sed 's/$OmitLocalLogging on/$OmitLocalLogging off/' \
              -i /etc/rsyslog.conf;                              \
    /bin/sed 's/$IMJournalStateFile imjournal.state/#         \
               $IMJournalStateFile imjournal.state/'           \
              -i /etc/rsyslog.conf;                              \
    /bin/sed '/$SystemLogSocketName/s/^/#/' /etc/rsyslog.d/listen.conf

# install rpms for Interstage
RUN /bin/yum -y install \
    cpp.x86_64 gcc.x86_64 gcc-c++.x86_64 gdb.x86_64 glibc-devel.x86_64 \
    glibc-headers.x86_64 krb5-workstation.x86_64 libICE.x86_64          \
    libSM.x86_64                                                            \
    libX11.x86_64 libX11-common.noarch libXau.x86_64 libXext.x86_64    \
    libXi.x86_64 libXp.x86_64 libXrender.x86_64 libXt.x86_64            \
    libXtst.x86_64                                                          \
    libstdc++-devel.x86_64 libtool-ltdl.x86_64 libxcb.x86_64 mpfr.x86_64 \
    perl.x86_64 perl-Module-Pluggable.noarch perl-Pod-Escapes.noarch   \
    perl-Pod-Simple.noarch perl-libs.x86_64 perl-version.x86_64         \
    redhat-lsb.x86_64 strace.x86_64 tcsh.x86_64 unixODBC.x86_64         \
    lksctp-tools.x86_64 kernel-headers.x86_64 systemd.x86_64            \
    rsyslog.x86_64 iproute.x86_64

# For minimum ipc resources
RUN echo '### for IAPS ###'                  >> /etc/sysctl.conf && \
    echo 'kernel.sem = 1100 35406 200 1600' >> /etc/sysctl.conf && \
    echo 'kernel.shmall = 4294967296'        >> /etc/sysctl.conf && \
    echo 'kernel.shmmax = 68719476736'       >> /etc/sysctl.conf && \
    echo 'kernel.shmmni = 4315'               >> /etc/sysctl.conf && \
    echo 'kernel.msgmax = 65536'              >> /etc/sysctl.conf && \
    echo 'kernel.msgmnb = 4194304'            >> /etc/sysctl.conf && \
    echo 'kernel.msgmni = 8199'               >> /etc/sysctl.conf

# Change kernel parameters and remove IPCs before systemd start
RUN echo ''                                       >> /etc/rc.local && \
    echo '# change kernel parameters'           >> /etc/rc.local && \
    echo '/usr/sbin/sysctl -p'                   >> /etc/rc.local && \
    echo '# remove IPCs before systemd start'  >> /etc/rc.local && \
    echo "QUES=\`/usr/bin/ipcs -q | /usr/bin/grep 0x |               \
                   /usr/bin/awk '{ print(\$2) }' |                     \
                   /usr/bin/tr '\n' ' ' \`"      >> /etc/rc.local &&  \
    echo "MSGS=\`/usr/bin/ipcs -m | /usr/bin/grep 0x |               \
                   /usr/bin/awk '{ print(\$2) }' |                    \
                  /usr/bin/tr '\n' ' ' \`"       >> /etc/rc.local &&  \
    echo "SEMS=\`/usr/bin/ipcs -s | /usr/bin/grep 0x | \
                   /usr/bin/awk '{ print(\$2) }' |                    \
                  /usr/bin/tr '\n' ' ' \`"       >> /etc/rc.local && \
    echo ''                                        >> /etc/rc.local && \
    echo 'for QUE in ${QUES}'                    >> /etc/rc.local && \
    echo 'do'                                      >> /etc/rc.local && \
    echo ' /usr/bin/ipcrm -q ${QUE}'             >> /etc/rc.local && \
    echo 'done'                                    >> /etc/rc.local && \
    echo ''                                        >> /etc/rc.local && \
    echo 'for MSG in ${MSGS}'                    >> /etc/rc.local && \
    echo 'do'                                      >> /etc/rc.local && \
    echo ' /usr/bin/ipcrm -m ${MSG}'             >> /etc/rc.local && \
    echo 'done'                                    >> /etc/rc.local && \
    echo ''                                        >> /etc/rc.local && \
    echo 'for SEM in ${SEMS}'                    >> /etc/rc.local && \
    echo 'do'                                      >> /etc/rc.local && \
    echo ' /usr/bin/ipcrm -s ${SEM}'             >> /etc/rc.local && \
    echo 'done'                                    >> /etc/rc.local && \
    /usr/bin/chmod u+x /etc/rc.local &&  \
    /usr/bin/systemctl enable rc-local.service > /dev/null 2>&1

# Install unit files for Interstage
COPY ./unitfiles/FJSVisas_start.service /lib/systemd/system
COPY ./unitfiles/FJSVisas_inspect_start.service /lib/systemd/system
RUN /usr/bin/chmod 0644 /lib/systemd/system/FJSVisas_start.service && \
    /usr/bin/systemctl enable FJSVisas_start.service && \
    /usr/bin/chmod 0644 \
    /lib/systemd/system/FJSVisas_inspect_start.service && \
    /usr/bin/systemctl enable FJSVisas_inspect_start.service

# set Env for Interstage install
ENV CIR_INST_SKIP yes
ENV TERM xterm
RUN /work/iaps/installer/install.sh -s /work/corba.csv

# remove Interstage installer
RUN rm -fr /work/corba.csv /work/iaps

# Specify executable when run this docker image
CMD [ "/usr/sbin/init" ]