Java EE 7ベアイメージ作成時に使用するDockerfileの定義内容を以下の図に記載します。
なお、以下の図は、ベースイメージにregistry.access.redhat.com/rhel7.3を使用する例です。
# Get Base image FROM registry.access.redhat.com/rhel7.3 RUN /bin/yum clean all -y # Set up SELinux RUN /bin/mkdir -p /etc/selinux/targeted/contexts/; \ /bin/echo '<busconfig><selinux></selinux></busconfig>' > \ /etc/selinux/targeted/contexts/dbus_contexts # Set up Systemd ENV container docker RUN /bin/yum -y swap -- remove fakesystemd -- install systemd \ systemd-libs && \ /bin/yum clean all -y; \ /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/yum clean all -y; \ /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 OS packages 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 \ iproute.x86_64 kernel-headers.x86_64 krb5-workstation.x86_64 \ libICE.x86_64 libSM.x86_64 \ libstdc++-devel.x86_64 libtool-ltdl.x86_64 libX11.x86_64 \ libX11-common.noarch libXau.x86_64 \ libxcb.x86_64 libXext.x86_64 libXi.x86_64 libXp.x86_64 \ libXrender.x86_64 libXt.x86_64 \ libXtst.x86_64 lksctp-tools.x86_64 mpfr.x86_64 perl.x86_64 \ perl-libs.x86_64 \ perl-Module-Pluggable.noarch perl-Pod-Escapes.noarch \ perl-Pod-Simple.noarch perl-version.x86_64 \ redhat-lsb.x86_64 rsyslog.x86_64 strace.x86_64 systemd.x86_64 \ tcsh.x86_64 unixODBC.x86_64 && \ /bin/yum clean all -y; # Set Env for Interstage install ENV CIR_INST_SKIP yes ENV TERM xterm # Set Japanese 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 && /bin/yum clean all -y ENV LANG=${lang_env} LANGUAGE="${lang_env}" LC_ALL="${lang_env}" # Set Japanese time zone ARG timezone="Asia/Tokyo" RUN /bin/yum -y reinstall tzdata && /bin/yum clean all -y; \ /bin/ln -snf /usr/share/zoneinfo/${timezone} /etc/localtime # Specify executable when run this docker image CMD [ "/usr/sbin/init" ]