创建基于 WebSphere 8.5.5.14 FullProfile 的 Docker

引子

我们将创建一个针对WebSphere 8.5.5.14 FullProfile的Docker。由于我们想要将其用作intra-mart的验证环境,我们将事先执行intra-mart所需的设置。通过执行intra-mart Accel Platform安装指南(WebSphere版),我们可以轻松地创建一个与IBM官方Docker镜像不同的环境,可以立即用于验证,而不需要任何额外的考虑。

基于Docker的镜像(CentOS 6.10)。

我将像往常一样从基本镜像开始构建。
我将使用CentOS 6.10最终版本进行操作。

FROM centos:centos6

EXPOSE 22

# yum
RUN yum -y update \
 && yum provides -y '*/applydeltarpm' \
 && yum groupinstall -y 'Development Tools' \
 && yum install -y --enablerepo centosplus wget curl vim emacs tar unzip mlocate perl ssh openssh-server openssl-devel \
 && rm -rf /var/cache/yum/* \
 && yum clean all

# locale
RUN yum reinstall -y glibc-common \
 && localedef -i ja_JP -f UTF-8 ja_JP.utf8 \
 && touch /etc/sysconfig/i18n \
 && echo 'LANG="ja_JP.UTF-8"' >> /etc/sysconfig/i18n
ENV LANG ja_JP.UTF-8
ENV LC_ALL ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja

# timezone
RUN yum install -y tzdata \
 && echo 'ZONE="Asia/Tokyo"' > /etc/sysconfig/clock \
 && echo 'UTC=false' >> /etc/sysconfig/clock \
 && ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

# root passwd
RUN bash -c 'echo "root:password" | chpasswd'

# ssh
RUN sed -i -e "s/#PasswordAuthentication yes/PasswordAuthentication yes/g" /etc/ssh/sshd_config \
 && sed -i -e "s/#PermitRootLogin yes/PermitRootLogin yes/g" /etc/ssh/sshd_config \
 && sed -i -e "s/UsePAM yes/UsePAM no/g" /etc/ssh/sshd_config

RUN updatedb

CMD /etc/init.d/sshd restart && /bin/bash

开始建设。

docker build -t mycentos:6.10 .

根据已经创建的基础映像,创建另一个基础映像。
考虑到准备另外一个数据库可能比较麻烦,所以我们将一起安装好PostgreSQL和Cassandra,并在启动时使其立即可用。

FROM mycentos:6.10

EXPOSE 22 5432 8983 9160

# yum
RUN yum -y update \
 && yum -y upgrade && yum -y update \
 && yum localinstall -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm \
 && yum install -y postgresql96-server \
 && yum install -y --setopt=protected_multilib=false epel-release ld-linux.so.2 libstdc++.so.6 libpng12 nc \
 && rm -rf /var/cache/yum/* \
 && yum clean all

# JDK
COPY setup_jdk.sh /setup_jdk.sh
RUN chmod +x /setup_jdk.sh \
 && /setup_jdk.sh \
 && rm -f /setup_jdk.sh \
 && echo 'JAVA_HOME=/usr/local/java/jdk' >> /root/.bashrc \
 && echo 'PATH=$PATH:/usr/local/java/jdk/bin' >> /root/.bashrc
ENV JAVA_HOME /usr/local/java/jdk
ENV PATH /usr/local/java/jdk/bin:$PATH

# PostgreSQL
COPY setup_postgresql.sh /setup_postgresql.sh
RUN chmod +x /setup_postgresql.sh \
 && /setup_postgresql.sh \
 && rm -f /setup_postgresql.sh

# JDBC Driver
RUN mkdir -p /opt/jdbc
COPY postgresql-42.2.5.jar /opt/jdbc/postgresql.jar
COPY db2jcc4.jar /opt/jdbc/db2.jar
COPY ojdbc8.jar /opt/jdbc/oracle.jar
COPY mssql-jdbc-7.0.0.jre8.jar /opt/jdbc/sqlserver.jar
COPY ngdbc.jar /opt/jdbc/ngdbc.jar

# Cassandra
COPY setup_cassandra.sh /setup_cassandra.sh
RUN chmod +x /setup_cassandra.sh \
 && /setup_cassandra.sh \
 && rm -f /setup_cassandra.sh \
 && echo 'PATH=$PATH:/usr/local/apache-cassandra/apache-cassandra/bin' >> /root/.bashrc
ENV PATH $PATH:/usr/local/apache-cassandra/apache-cassandra/bin

# Solr
COPY setup_solr.sh /setup_solr.sh
RUN chmod +x /setup_solr.sh \
 && /setup_solr.sh \
 && rm -f /setup_solr.sh

# wkhtmltopdf
COPY setup_wkhtmltopdf.sh /setup_wkhtmltopdf.sh
RUN chmod +x /setup_wkhtmltopdf.sh \
 && /setup_wkhtmltopdf.sh \
 && rm -f /setup_wkhtmltopdf.sh

RUN updatedb

CMD ["/opt/IBM/InstallationManager/eclipse/tools/imcl", "-c"]
#!/bin/sh

curl -L -C - -O https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar -Jxvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
rm -f wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

mv wkhtmltox /usr/local/wkhtmltox
ln -s /usr/local/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf

yum install -y vlgothic-fonts

安装PostgreSQL。在安装完成后,创建以下用户。

    • postgres/postgres (ユーザ/パスワード)

 

    imart/imart (ユーザ/パスワード)

此外,我们还将创建以下数据库。

    • imart

 

    • iap_db

 

    default

而且,还要创建 acceldocuments 的架构。

出于适当的安慰措施,我们将增加默认的 max_connections 和 shared_buffers 值,因为它们目前的设置过小。

#!/bin/bash

service postgresql-9.6 initdb

echo "listen_addresses = '*'" >> /var/lib/pgsql/9.6/data/postgresql.conf
sed -i -e "s/ident$/trust/g" /var/lib/pgsql/9.6/data/pg_hba.conf
sed -i -e "s/127\.0\.0\.1\/32/0\.0\.0\.0\/0/g" /var/lib/pgsql/9.6/data/pg_hba.conf

sed -i -e "s/max_connections = 100/max_connections = 200/g" /var/lib/pgsql/9.6/data/postgresql.conf
sed -i -e "s/shared_buffers = 128MB/shared_buffers = 512MB/g" /var/lib/pgsql/9.6/data/postgresql.conf

echo "postgres:postgres" | chpasswd

service postgresql-9.6 start
sleep 1

su postgres -c "psql -c \"ALTER USER postgres WITH PASSWORD 'postgres'\""
su postgres -c "psql -c \"CREATE ROLE imart WITH LOGIN PASSWORD 'imart'\""
su postgres -c "psql -c \"CREATE DATABASE imart OWNER=imart encoding 'utf8' TEMPLATE template0\""
su postgres -c "psql -c \"CREATE DATABASE iap_db OWNER=imart encoding 'utf8' TEMPLATE template0\""
su postgres -c "psql -c \"CREATE DATABASE \\\"default\\\" OWNER=imart encoding 'utf8' TEMPLATE template0\""
su postgres -c "psql -d imart -c \"CREATE SCHEMA acceldocuments AUTHORIZATION imart\""
su postgres -c "psql -d iap_db -c \"CREATE SCHEMA acceldocuments AUTHORIZATION imart\""
su postgres -c "psql -d default -c \"CREATE SCHEMA acceldocuments AUTHORIZATION imart\""

service postgresql-9.6 stop

关于 JDK 的下载,如果最新版本是8u191,您可以使用以下 curl 命令进行下载。
如果8u191不再是最新版本,则需要修改URL才能下载,请根据需要进行修改。
如果您觉得麻烦,可以在浏览器中下载 JDK,然后通过 Dockerfile 的 COPY 命令将其复制到根目录下,并使用 COPY 命令配置的 JDK,而非使用下面的 curl 命令,这样也没有问题。

#!/bin/sh

curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz
tar zxvf jdk-8u191-linux-x64.tar.gz
rm -f jdk-8u191-linux-x64.tar.gz

mkdir -p /usr/local/java
mv jdk1.8.0_191 /usr/local/java/jdk1.8.0_191
ln -s /usr/local/java/jdk1.8.0_191 /usr/local/java/jdk
#!/bin/sh

curl -L -C - -O https://archive.apache.org/dist/cassandra/1.1.12/apache-cassandra-1.1.12-bin.tar.gz
tar -zxvf apache-cassandra-1.1.12-bin.tar.gz
rm apache-cassandra-1.1.12-bin.tar.gz

mkdir -p /usr/local/apache-cassandra
mv apache-cassandra-1.1.12 /usr/local/apache-cassandra/apache-cassandra-1.1.12
ln -s /usr/local/apache-cassandra/apache-cassandra-1.1.12 /usr/local/apache-cassandra/apache-cassandra

sed -i -e "s/Xss180k/Xss228k/g" /usr/local/apache-cassandra/apache-cassandra/conf/cassandra-env.sh

Solr的安装设置是通过curl获取设置材料,所以请提前准备好solr_setup.zip文件,以便从myserver下载。如果这太麻烦的话,您可以在浏览器中下载solr_setup.zip文件,然后从Dockerfile中使用COPY命令将其放置在根目录下,这样就可以使用COPY命令来使用放置的solr_setup.zip文件,而不是使用以下的curl命令,也没有问题。

#!/bin/sh

curl -L -C - -O http://myserver/solr_setup.zip
unzip solr_setup.zip -d solr_setup
rm solr_setup.zip

cd solr_setup
chmod u+x ./setup.sh
./setup.sh jetty

mkdir -p /usr/local/solr
mv dist/jetty/jetty /usr/local/solr/jetty

cd ..
rm -rf solr_setup

我要开始建设。

docker build -t mywas_base .

Docker WebSphere 8.5.5.14 全型录

现在是 WebSphere 8.5.5.14 FullProfile 的 Docker。
我们将使用之前的 mywas_base 作为基本镜像。

除了 Dockerfile 外,还需要准备以下文件。

    • run_server.sh

 

    • setup_was.sh

 

    • startServer.sh

 

    • stopServer.sh

 

    • was85.rsp

 

    Dockerfile

首先,从 Dockerfile 开始。

FROM mywas_base

EXPOSE 22 5432 9009 9060 9080 40608

# yum
RUN yum -y update \
 && yum -y upgrade && yum -y update \
 && yum install -y multitail ncurses-devel ncurses-static ncurses-term \
 && rm -rf /var/cache/yum/* \
 && yum clean all

# setup_was
COPY setup_was.sh /opt/setup_was.sh
COPY was85.rsp /opt/was85.rsp
RUN chmod +x /opt/setup_was.sh \
 && /opt/setup_was.sh \
 && rm -f /opt/setup_was.sh

COPY run_server.sh /opt/run_server.sh
COPY startServer.sh /opt/startServer.sh
COPY stopServer.sh /opt/stopServer.sh
RUN chmod +x /opt/run_server.sh \
 && chmod +x /opt/startServer.sh \
 && chmod +x /opt/stopServer.sh \
 && ln -s /opt/startServer.sh /startServer.sh \
 && ln -s /opt/stopServer.sh /stopServer.sh \
 && ln -s /opt/startServer.sh /root/startServer.sh \
 && ln -s /opt/stopServer.sh /root/stopServer.sh \
 && ln -s /opt/run_server.sh /run_server.sh \
 && ln -s /opt/run_server.sh /root/run_server.sh

# COPY cell_node_resources.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/resources.xml
# COPY cell_node_server.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/server.xml
# COPY cell_security.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/security.xml

RUN updatedb

CMD ["/opt/run_server.sh"]

以下的3行注释将在稍后使用。现在可以保持注释状态不变。
在注释状态下,首先执行docker build和docker run命令,然后在WebSphere管理界面上对intra-mart进行配置(包括-Xmx、事务超时、数据源等设置)。
这些配置将反映到被注释的路径上(通过比较配置反映前后的/opt/IBM/WebSphere文件夹差异,如使用WinMerge等工具进行判断),然后获取配置反映后的上述路径文件,取消注释(注释转为正常代码),再次执行docker build命令。
通过这种方式,可以创建一个已配置intra-mart的WebSphere Docker镜像。

接下来是WebSphere 8.5.5.14 FullProfile的安装设置。

为了获取设置资料,使用curl安装的指令,因此请提前准备好从myserver下载资料。如果这也很麻烦的话,可以通过浏览器下载设置资料,并通过Dockerfile中的COPY指令将其置于/opt目录下。同时,使用COPY放置的设置资料可以替代以下的curl指令使用,也不会有问题。

您可以从以下链接下载安装资料。

    • Installation Manager

 

    • https://www-01.ibm.com/support/docview.wss?uid=swg27036453

 

    • WebSphere 8.5.5.0

 

    • https://www-01.ibm.com/support/docview.wss?uid=swg24034969

 

    • WebSphere Fix Pack 8.5.5.15

 

    • https://www-01.ibm.com/support/docview.wss?uid=swg27009661

 

    • Java

 

    https://www-01.ibm.com/support/docview.wss?uid=ibm10726035
#!/bin/bash

echo "IBM WAS install script"

cd /opt

# download repository
echo "Downloading repository..."
WAS_REPOSITORY_BASE_URL="http://myserver"
curl -L -C - -o im.zip "${WAS_REPOSITORY_BASE_URL}/agent.installer.linux.gtk.x86_64_1.8.8000.20171130_1105.zip"
curl -L -C - -o was1.zip "${WAS_REPOSITORY_BASE_URL}/was.repo.8550.developers.ilan_part1.zip"
curl -L -C - -o was2.zip "${WAS_REPOSITORY_BASE_URL}/was.repo.8550.developers.ilan_part2.zip"
curl -L -C - -o was3.zip "${WAS_REPOSITORY_BASE_URL}/was.repo.8550.developers.ilan_part3.zip"
curl -L -C - -o java1.zip "${WAS_REPOSITORY_BASE_URL}/8.0.5.17-WS-IBMWASJAVA-part1.zip"
curl -L -C - -o java2.zip "${WAS_REPOSITORY_BASE_URL}/8.0.5.17-WS-IBMWASJAVA-part2.zip"
curl -L -C - -o wasfp_1.zip "${WAS_REPOSITORY_BASE_URL}/8.5.5-WS-WAS-FP014-part1.zip"
curl -L -C - -o wasfp_2.zip "${WAS_REPOSITORY_BASE_URL}/8.5.5-WS-WAS-FP014-part2.zip"
curl -L -C - -o wasfp_3.zip "${WAS_REPOSITORY_BASE_URL}/8.5.5-WS-WAS-FP014-part3.zip"

# im
echo "Installing IBM Installation Manager..."
mkdir iminstall
unzip -q im.zip -d iminstall

cd iminstall
ln -s jre_7.0.100010.20170822_1251/ jre
./installc --launcher.ini silent-install.ini -acceptLicense

cd /opt

rm -rf iminstall
rm -f im.zip

# was base files
mkdir was8550repo
echo "Unpacking base files..."
unzip -q was1.zip -d was8550repo
unzip -q was2.zip -d was8550repo
unzip -q was3.zip -d was8550repo
rm -f was1.zip was2.zip was3.zip

# jdk files
mkdir javarepo
echo "Unpacking java files..."
unzip -q java1.zip -d javarepo
unzip -q java2.zip -d javarepo
rm -f java1.zip java2.zip

# was fp
mkdir wasfprepo
echo "Unpacking fp files..."
unzip -q wasfp_1.zip -d wasfprepo
unzip -q wasfp_2.zip -d wasfprepo
unzip -q wasfp_3.zip -d wasfprepo
rm -f wasfp_1.zip wasfp_2.zip wasfp_3.zip

echo "Installing Java and WAS..."
/opt/IBM/InstallationManager/eclipse/tools/imcl -acceptLicense -showProgress input /opt/was85.rsp
rm -f was85.rsp

echo "Removing repos..."
rm -rf was8550repo javarepo wasfprepo

echo "Creating default profile..."
/opt/IBM/WebSphere/AppServer/bin/manageprofiles.sh -create -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default

我们正在进行WebSphere 8.5.5.0、WebSphere修复包8.5.5.15以及IBM WebSphere Java SDKs 8.0.5.17的静默安装。

如果要安装WebSphere 8.5.5.14之外的版本,除了setup_was.sh脚本外,还需要编辑这个响应文件才能进行静默安装。

<?xml version="1.0" encoding="UTF-8"?>

<agent-input clean="true" temporary="true">

<server>
  <repository location='/opt/was8550repo'/>
  <repository location='/opt/wasfprepo'/>
  <repository location='/opt/javarepo'/>
</server>

<install>
  <offering id='com.ibm.websphere.DEVELOPERSILAN.v85'
   profile='IBM WebSphere Application Server for Developers (ILAN) 8.5.5.14'/>

  <offering id='com.ibm.websphere.IBMJAVA.v80'
   profile='IBM WebSphere Application Server V8.5' installFixes='none'/>
</install>

<profile id='IBM WebSphere Application Server for Developers (ILAN) 8.5.5.14' installLocation='/opt/IBM/WebSphere/AppServer'>
  <data key='eclipseLocation' value='/opt/IBM/WebSphere/AppServer'/>
  <data key='user.import.profile' value='false'/>
  <data key='cic.selector.nl' value='ja'/>
  <data key='user.wasjava' value='java8'/>
</profile>

<preference name='com.ibm.cic.common.core.preferences.eclipseCache' value='/opt/IBM/IMShared'/>
<preference name='com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.connectTimeout' value='30'/>
<preference name='com.ibm.cic.common.core.preferences.readTimeout' value='45'/>
<preference name='com.ibm.cic.common.core.preferences.downloadAutoRetryCount' value='0'/>
<preference name='offering.service.repositories.areUsed' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.ssl.nonsecureMode' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.http.disablePreemptiveAuthentication' value='false'/>
<preference name='http.ntlm.auth.kind' value='NTLM'/>
<preference name='http.ntlm.auth.enableIntegrated.win32' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.keepFetchedFiles' value='false'/>
<preference name='PassportAdvantageIsEnabled' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.searchForUpdates' value='false'/>
<preference name='com.ibm.cic.agent.ui.displayInternalVersion' value='false'/>

</agent-input>

接下来是在docker运行时执行的WebSphere启动脚本。
还会同时启动sshd、PostgreSQL、Cassandra和Solr。
由于我想要显示两个日志文件(SystemOut.log和SystemErr.log),所以如果可用的话会使用multitail来输出日志。
如果环境不支持,将会使用tail来输出日志。

#!/bin/bash

originalTerm="${TERM}"
if [ ${originalTerm} != "xterm" ]; then
    export TERM=xterm
fi

/etc/init.d/sshd start
service postgresql-9.6 restart

cassandra &
cd /usr/local/solr/jetty
./startup.sh &

/opt/IBM/WebSphere/AppServer/bin/startServer.sh server1 &
while [ ! -r /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemOut.log ]
do
    sleep 1
done
while [ ! -r /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemErr.log ]
do
    sleep 1
done

if [ ${originalTerm} = "xterm" ]; then
    multitail -M 0 --follow-all --retry-all /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemOut.log -I /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemErr.log
else
    tail -F /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemOut.log /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemErr.log
fi
#!/bin/sh

cd /opt/IBM/WebSphere/AppServer/bin
./startServer.sh server1
#!/bin/sh

cd /opt/IBM/WebSphere/AppServer/bin
./stopServer.sh server1

如果能做到这一步,就先进行一次构建,然后执行。

docker build -t mywas:8.5.5.14 .
docker run -it --rm -p 9060:9060 -p 9080:9080 -p 40608:40608 -p 5432:5432 -p 2222:22 -p 9009:9009 mywas:8.5.5.14

执行后,您可以通过 SSH 登录到容器中(可使用 root/password 登录)。

zip -r WebSphere.zip /opt/IBM/WebSphere

执行,并保存在设置之前的状态(WebSphere.zip)。保存后,进行intra-mart Accel Platform安装指南(WebSphere版本)的设置。

完成設定後,使用SSH登入容器。

zip -r WebSphere2.zip /opt/IBM/WebSphere

执行操作,并保存设置后的状态(WebSphere2.zip)。
使用WinMerge等工具比较WebSphere.zip和WebSphere2.zip的内容。
可能会检测到以下3个文件的差异(忽略日志文件的差异,因为它们不重要)。

    • /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/resources.xml

 

    • /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/server.xml

 

    /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/security.xml

由于在 docker build 期间可能会受到主机名的影响,因此在路径中的 32f0c14c1a1eNode01Cell 和 32f0c14c1a1eNode01 部分可能会在每次 docker build 时变为不同的值(并且上述 3 个文件中也应该含有受 docker build 期间主机名影响的设置)。

取得上述的三个文件后,

resources.xml -> cell_node_resources.xml
server.xml -> cell_node_server.xml
security.xml -> cell_security.xml

资源.xml -> 单元节点资源.xml
服务器.xml -> 单元节点服务器.xml
安全.xml -> 单元安全.xml

将文件名更改并取消Dockerfile中以下已注释的部分的注释(注释解除)。

# COPY cell_node_resources.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/resources.xml
# COPY cell_node_server.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/server.xml
# COPY cell_security.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/security.xml

请用中文给以下内容进行释义:↓

COPY cell_node_resources.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/resources.xml
COPY cell_node_server.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/server.xml
COPY cell_security.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/security.xml

修改完成后,请再次运行docker build。

docker build -t mywas:8.5.5.14 .

应该是从执行了三个 COPY 命令之前的命令之后构建的镜像进行增量构建(不是从头开始构建,而是从取消注释的 COPY 命令的行开始构建)。因此,在构建时使用的主机名也将与执行取消注释的 COPY 命令之前相同的主机名进行构建。

如果将中间构建图像全部删除,重新从头构建,那么

COPY cell_node_resources.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/resources.xml
COPY cell_node_server.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/nodes/32f0c14c1a1eNode01/servers/server1/server.xml
COPY cell_security.xml /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/32f0c14c1a1eNode01Cell/security.xml

由于此命令的路径名称可能会发生更改,所以最好不要删除中间构建图像,而是正常地进行增量构建。

也许,在Dockerfile的开头

ENV HOSTNAME websphere

使用 `-h` 标志在 `docker build` 过程中设置相同的主机名可能会减少问题的发生。

启动

docker run -it -p 9060:9060 -p 9080:9080 -p 40608:40608 -p 5432:5432 -p 2222:22 -p 9009:9009 mywas:8.5.5.14

由于已经安装了PostgreSQL、Solr和Cassandra,只需部署war文件即可立即进行验证。

使用SSH

ssh -p 2222 root@localhost

如果在运行docker时设置了-p 2222:22的话,2222就是ssh端口。
可以使用root/password进行登录。
请将localhost 替换为正在运行docker的机器的IP地址。

部署

请参考以下指南,在intra-mart Accel平台中部署war文件:
intra-mart Accel平台设置指南(适用于WebSphere)中的war文件部署
在war文件部署完成后,请进行以下类加载器设置:
intra-mart Accel平台设置指南(适用于WebSphere)中的类加载器设置

網址

    • WebSphere 管理画面

 

    • http://localhost:9060/admin

 

    • war デプロイ後の一般ユーザログイン画面

 

    • http://localhost:9080/imart/login

 

    • war デプロイ後のシステムユーザログイン画面

 

    http://localhost:9080/imart/system/login

请将 localhost 替换为运行 Docker 的机器的 IP 地址。

就此简单介绍了配置好的Docker用于WebSphere 8.5.5.14 FullProfile intra-mart的情况。

广告
将在 10 秒后关闭
bannerAds