WebLogic 1036的镜像构建
WebLogic1035版本构建出来的镜像有问题,部署应用激活后返回的是后面pod的ip和端口号,在1036版本和12.1.3版本都无此问题。
weblogic 1036的Dockerfile
[root@k8s-node- weblogic1036jdk1.]# cat Dockerfile
#CENSE MIT License
#
# GIBAHOLMS DOCKERFILES PROJECT
# -----------------------------------------
# This is the Dockerfile for a default installation for Oracle WebLogic Server 11g (10.3.) Generic Distribution
#
# IMPORTANT
# -----------------------------------------
# The resulting image of this Dockerfile DOES NOT contain a WLS Domain.
# For that, you must to create a domain on a new inherited image.
#
# REQUIRED FILES TO BUILD THIS IMAGE
# -----------------------------------------
# () wls1036_generic.jar (Oracle WebLogic Server 10.3. Generic Installer)
#
# () jdk-7u79-linux-x64.rpm (Oracle Java SE Development Kit for Linux x64 RPM)
#
# HOW TO BUILD THIS IMAGE
# -----------------------------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
# $ sudo docker build -t gibaholms/weblogic:10.3. .
#
# AUTHOR
# -----------------------------------------
# Gilberto Holms <gibaholms85@gmail.com>
# https://gibaholms.wordpress.com/
# ----------------------------------------- # Pull base image
# ---------------
FROM oraclelinux: # Maintainer
# ----------
MAINTAINER ericnie <niejian437> # Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
ENV JAVA_RPM jdk-6u45-linux-x64.bin
ENV WLS_PKG wls1036_generic.jar
ENV JAVA_HOME /u01/jdk1..0_45 # Setup required packages (unzip), filesystem, and oracle user
# ------------------------------------------------------------
RUN mkdir -p /u01/oracle && \
chmod a+xr /u01 COPY $JAVA_RPM wls-silent.xml /u01/ # Install and configure Oracle JDK
# -------------------------------------
WORKDIR /u01 RUN /u01/$JAVA_RPM && \
rm /u01/$JAVA_RPM WORKDIR /u01 ENV PATH $PATH:/u01/jdk1..0_45/bin # Installation of WebLogic
COPY $WLS_PKG /u01/
RUN /u01/jdk1..0_45/bin/java -jar $WLS_PKG -mode=silent -silent_xml=/u01/wls-silent.xml && \
rm -rf /u01/$WLS_PKG && \
rm -rf /u01/wls-silent.xml && \
rm -rf /tmp/* WORKDIR /u01/oracle/ #ENV PATH $PATH:/u01/oracle/wlserver_10.3/common/bin # Define default command to start bash.
涉及到的wls-silent.xml文件.
[root@k8s-node- weblogic1036jdk1.]# cat wls-silent.xml
<?xml version="1.0" encoding="UTF-8"?>
<bea-installer>
<input-fields>
<data-value name="BEAHOME" value="/u01/oracle" />
<data-value name="USER_INSTALL_DIR" value="/u01/oracle" />
<data-value name="COMPONENT_PATHS" value="WebLogic Server/Core Application Server|WebLogic Server/Administration Console|WebLogic Server/Configuration Wizard and Upgrade Framework|WebLogic Server/Web 2.0 HTTP Pub-Sub Server|WebLogic Server/WebLogic JDBC Drivers|WebLogic Server/Third Party JDBC Drivers|WebLogic Server/WebLogic Server Clients|WebLogic Server/WebLogic Web Server Plugins|WebLogic Server/UDDI and Xquery Support" />
<data-value name="INSTALL_NODE_MANAGER_SERVICE" value="no" />
<data-value name="INSTALL_SHORTCUT_IN_ALL_USERS_FOLDER" value="no"/>
<data-value name="LOCAL_JVMS" value="/u01/jdk1.6.0_45"/>
</input-fields>
</bea-installer>
构建域
[root@k8s-node- 1036domainjdk6]# cat Dockerfile
# LICENSE CDDL 1.0 + GPL 2.0
#
# Copyright (c) - Oracle and/or its affiliates. All rights reserved.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This Dockerfile extends the Oracle WebLogic image by creating a sample domain.
#
# The 'base-domain' created here has Java EE APIs enabled by default:
# - JAX-RS 2.0 shared lib deployed
# - JPA 2.1,
# - WebSockets and JSON-P
#
# Util scripts are copied into the image enabling users to plug NodeManager
# magically into the AdminServer running on another container as a Machine.
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
# $ sudo docker build -t -domain --build-arg ADMIN_PASSWORD=welcome1 .
# # Pull base image
# ---------------
FROM ericnie/weblogic:10.3.-jdk6u45v2 # Maintainer
# ----------
MAINTAINER Bruno Borges <bruno.borges@oracle.com> # WLS Configuration
# -------------------------------
ARG ADMIN_PASSWORD
ARG PRODUCTION_MODE ENV DOMAIN_NAME="base_domain" \
DOMAIN_HOME="/u01/oracle/user_projects/domains/base_domain" \
ADMIN_PORT="" \
ADMIN_HOST="wlsadmin" \
NM_PORT="" \
MS_PORT="" \
PRODUCTION_MODE="${PRODUCTION_MODE:-prod}" \
JAVA_OPTIONS="-Dweblogic.security.SSL.ignoreHostnameVerification=true -Djava.security.egd=file:///dev/urandom" \
CLASSPATH="" \
PATH=$PATH:/u01/oracle/wlserver_10./common/bin:/u01/oracle/user_projects/domains/base_domain/bin:/u01/oracle/ # Add files required to build this image
COPY container-scripts/* /u01/oracle/ RUN mkdir /u01/oracle/application # Configuration of WLS Domain
WORKDIR /u01/oracle
RUN /u01/oracle/wlst /u01/oracle/create-wls-domain.py && \
mkdir -p /u01/oracle/user_projects/domains/base_domain/servers/AdminServer/security && \
echo "username=weblogic" > /u01/oracle/user_projects/domains/base_domain/servers/AdminServer/security/boot.properties && \
echo "password=$ADMIN_PASSWORD" >> /u01/oracle/user_projects/domains/base_domain/servers/AdminServer/security/boot.properties && \
cp /u01/oracle/setDomainEnv.sh /u01/oracle/user_projects/domains/base_domain/bin/setDomainEnv.sh && \
echo ". /u01/oracle/user_projects/domains/base_domain/bin/setDomainEnv.sh" >> /u01/oracle/.bashrc && \
echo "export PATH=$PATH:/u01/oracle/wlserver_10.3/common/bin:/u01/oracle/user_projects/domains/base_domain/bin" >> /u01/oracle/.bashrc && \
rm /u01/oracle/create-wls-domain.py /u01/oracle/jaxrs2-template.jar # cp /u01/oracle/commEnv.sh /u01/oracle/wlserver_10.3/common/bin/commEnv.sh && \
# Expose Node Manager default port, and also default http/https ports for admin console
EXPOSE $NM_PORT $ADMIN_PORT $MS_PORT WORKDIR $DOMAIN_HOME # Define default command to start bash.
CMD ["startWebLogic.sh"]
中间的create-wls-domain.py
[root@k8s-node- container-scripts]# cat create-wls-domain.py
# Copyright (c) - Oracle and/or its affiliates. All rights reserved.
#
# WebLogic on Docker Default Domain
#
# Domain, as defined in DOMAIN_NAME, will be created in this script. Name defaults to 'base_domain'.
#
# Since : October,
# Author: bruno.borges@oracle.com
# ==============================================
domain_name = os.environ.get("DOMAIN_NAME", "base_domain")
admin_port = int(os.environ.get("ADMIN_PORT", ""))
admin_pass = os.environ.get("ADMIN_PASSWORD")
cluster_name = os.environ.get("CLUSTER_NAME", "DockerCluster")
domain_path = '/u01/oracle/user_projects/domains/%s' % domain_name
production_mode = os.environ.get("PRODUCTION_MODE", "prod") print('domain_name : [%s]' % domain_name);
print('admin_port : [%s]' % admin_port);
print('cluster_name: [%s]' % cluster_name);
print('domain_path : [%s]' % domain_path);
print('production_mode : [%s]' % production_mode); # Open default domain template
# ======================
readTemplate("/u01/oracle/wlserver_10.3/common/templates/domains/wls.jar") set('Name', domain_name)
setOption('DomainName', domain_name) # Disable Admin Console
# --------------------
# cmo.setConsoleEnabled(false) # Configure the Administration Server and SSL port.
# =========================================================
cd('/Servers/AdminServer')
set('ListenAddress', '')
set('ListenPort', admin_port) # Define the user password for weblogic
# =====================================
cd('/Security/%s/User/weblogic' % domain_name)
cmo.setPassword(admin_pass) # Write the domain and close the domain template
# ==============================================
setOption('OverwriteDomain', 'true')
setOption('ServerStartMode', 'prod') # Write Domain
# ============
writeDomain(domain_path)
closeTemplate()
# Exit WLST
# =========
exit()
WebLogic 1036的镜像构建的更多相关文章
- 玩转docker镜像和镜像构建
摘要 本文从个人的角度,讲述对于docker镜像和镜像构建的一些实践经验.主要内容包括利用docker hub进行在线编译,下载镜像,dind的实践,对于镜像的一些思考等.本文是对当时微信分享内容的一 ...
- Docker镜像构建的两种方式
关于Docker里面的几个主要概念 这里用个不太恰当的比方来说明. 大家肯定安装过ghost系统,镜像就像是ghost文件,容器就像是ghost系统.你可以拿别人的ghost文件安装系统(使用镜像运行 ...
- docker之NGINX镜像构建
Nginx是一个高性能的Web和反向代理服务器,它具有很多非常优越的特性:1.作为Web服务器.2.作为负载均衡服务器.3.作为邮件代理服务器.4.安装及配置简单.接下来我们介绍在docker构建ng ...
- Docker镜像构建的两种方式(六)--技术流ken
镜像构建介绍 在什么情况下我们需要自己构建镜像那? (1)当我们找不到现有的镜像,比如自己开发的应用程序 (2)需要在镜像中加入特定的功能 docker构建镜像有两种方式:docker commit命 ...
- Docker镜像构建
一.简介 在构建容器化应用时,相当重要的步骤莫过于镜像制作,本文将介绍镜像制作方法以及镜像制作的建议.通常镜像的制作有两种方式: 使用现有的容器使用docker commit 生成镜像 使用Docke ...
- (转)Docker镜像构建上下文(Context)
镜像构建上下文(Context) Docker在构建镜像时,如果注意,会看到 docker build 命令最后有一个 ... 表示当前目录,而 Dockerfile 就在当前目录,因此不少初学者以为 ...
- Docker镜像构建上下文(Context)
镜像构建上下文(Context) Dicker在构建镜像时,如果注意,会看到 docker build 命令最后有一个 ... 表示当前目录,而 Dockerfile 就在当前目录,因此不少初学者以为 ...
- Docker镜像构建(五)
Docker 镜像介绍 Docker镜像构建分为两种,一种是手动构建,另一种是Dockerfile(自动构建) 手动构建docker镜像 案例:我们基于centos镜像进行构建,制作自己的nginx镜 ...
- vitess基础镜像构建流程Centos
以下列出了构建vitess使用的Centos镜像的简单流程,由于较早基础版本是Centos7.2的,重新构建可以基于最新的Centos版本构建 1.基础镜像拉取 #拉取官方版本 docker pull ...
随机推荐
- ASP.NET Core学习链接
https://www.cnblogs.com/artech/p/dependency-injection-in-asp-net-core.html http://www.cnblogs.com/ar ...
- mac系统命令行获取root权限
刚上手mac本,对系统各种操作不熟,把过程记录下来. 使用内置命令行工具时遇到权限问题,有两种方法,第一种是在每行命令之前加上sudo,例如: 第二种是直接使用roor账户,但是mac系统默认没有ro ...
- Nginx-进程模型
1.整体框架 正常执行起来的Nginx有很多进程,有master_process和worker_process进程,master_process是监控进程即主线程,worker_process是工作进 ...
- mybatis官网学习
javaType:一个 Java 类的完全限定名,或一个类型别名(参考上面内建类型别名 的列表) .如果你映射到一个 JavaBean,MyBatis 通常可以断定类型. 然而,如果你映射到的是 Ha ...
- centos7安装与卸载JDK
用yum安装JDK 首先检查jdk是否安装 rpm -qa | grep java 或者 java -version 1.查看yum库中都有哪些jdk版本(暂时只发现了openjdk) ...
- 8种json数据查询方式
你有没有对“在复杂的JSON数据结构中查找匹配内容”而烦恼.这里有8种不同的方式可以做到: JsonSQL JsonSQL实现了使用SQL select语句在json数据结构中查询的功能. 例子: ? ...
- Java实现POI读取Excel文件,兼容后缀名xls和xlsx
1.引入所需的jar包: maven管理项目的话直接添加以下坐标即可: <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -- ...
- CodeForces 723E One-Way Reform
构造. 有一种十分巧妙的方法可以使图中所有度数为偶数的节点,经过每条边定向后,出度和入度都相等. 首先统计每个节点的度数,将度数为奇数的节点与编号为$n+1$的节点连边,这样一来,这张新图变成了每个节 ...
- ZOJ 3327 Friend Number
构造. (1)如果数字中带有$0$: 1.只有个位是$0$,这种情况就是给输入的数字$+10$再输出即可. 2.其余情况就是给输入的数字$+1$再输出即可. (2)如果数字中没有$0$: 从个位开始一 ...
- Linux添加或修改ssh端口
1) 查看ssh服务是否安装齐全 这里使用”rpm –qa|grep ssh”命令查看. [root@xuexi ~]# rpm -qa | grep ssh libssh2-1.4.3-10.el ...