通过使用 WebSphere Application Server 二进制文件构建您自己的容器映像,或者通过扩展预先打包的 IBM® 容器映像,可以在容器中运行 WebSphere® Application Server 。
要在容器中运行 WebSphere Application Server ,请选择以下两种方法之一。
过程
- 使用 WebSphere Application Server 二进制文件以及 GitHub中的指示信息来构建您自己的容器映像。
- 扩展某个 IBM 预先打包的容器映像。
IBM WebSphere Application Server 的预打包容器镜像在 IBM Cloud Container Registry (ICR) 中,这是 IBM Cloud® 的公共容器注册表。这些镜像包含非授权程序国际许可协议 (ILAN) 许可证。 本许可允许有权 WebSphere Application Server 客户根据国际计划许可协议 (IPLA) 条款使用这些图像。
- 从预先配置的容器映像标记中进行选择。
- 为应用程序映像设置 Dockerfile 模板。
以下示例 Dockerfile 模板在 FROM 伪指令中指定具有最新版本的 WebSphere Application Server 的容器映像。
FROM icr.io/appcafe/websphere-traditional:latest
COPY --chown=was:root was-config.props /work/config/
COPY --chown=was:root myApp.war /work/app/
COPY --chown=was:root myAppDeploy.py dataSourceConfig.py /work/config/
RUN /work/configure.sh
- 类似这样的模板将创建用于添加单个应用程序和相应配置的映像。
- 不要在启动后手动配置容器(除非出于调试目的),因为这些更改不会反映在从映像创建的新容器中。
结果
您现在拥有包含应用程序及其配置的容器映像,这意味着您可以随时创建新的、完全配置的容器。