Sunday, February 21, 2021

JBoss Wildfly Kubernetes Operator

 HOWTO

 

GitHub repos


Build JBoss Wildfly Docker image GitHub repo https://github.com/dveselka/java-ee-8/tree/main/java-ee8-minimal Dockerfile
$ more Dockerfile
FROM jboss/wildfly

RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#123 --silent

COPY ./target/java-ee8-minimal.war /opt/jboss/wildfly/standalone/deployments/

CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]

Build Docker image

mvn clean package && docker build -t dveselka/java-ee8-minimal .
....

Sending build context to Docker daemon  111.6kB
Step 1/4 : FROM jboss/wildfly
latest: Pulling from jboss/wildfly
75f829a71a1c: Pull complete 
7b11f246b3d3: Pull complete 
b765648c2a58: Pull complete 
506aff4a9c5a: Pull complete 
a7ae73eec52a: Pull complete 
Digest: sha256:c0be1b7462a7ee9d07be5e319f7f2b10a93e5b43d51532ed012d2869e0224cf0
Status: Downloaded newer image for jboss/wildfly:latest
 ---> 13b4b5beba73
Step 2/4 : RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#123 --silent
 ---> Running in ecb1651c51fc
Removing intermediate container ecb1651c51fc
 ---> 74f6e50296e9
Step 3/4 : COPY ./target/java-ee8-minimal.war /opt/jboss/wildfly/standalone/deployments/
 ---> dd07d8a883fc
Step 4/4 : CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
 ---> Running in d9575f15ea43
Removing intermediate container d9575f15ea43
 ---> 01e0043e9e6f
Successfully built 01e0043e9e6f
Successfully tagged dveselka/java-ee8-minimal:latest

Docker image
[dave@dave java-ee8-minimal]$ docker images
REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE
dveselka/java-ee8-minimal       latest              01e0043e9e6f        3 minutes ago       714MB

Push Docker image to DockerHub
$ docker push   dveselka/java-ee8-minimal
The push refers to repository [docker.io/dveselka/java-ee8-minimal]
4a24521ab9d6: Pushed 
348cd5508b6f: Pushed 
9ef61a25476f: Mounted from jboss/wildfly 
869989761eb2: Mounted from jboss/wildfly 
3fbe1e874b0d: Mounted from jboss/wildfly 
115463be137a: Mounted from jboss/wildfly 
613be09ab3c0: Mounted from jboss/wildfly 
latest: digest: sha256:d416275117d084e0cf557f6cf1ad82dc0aba7bf67921e4f19703e9a48701b2ec size: 1790

Run in k8s
$ kubectl run java-ee8-minimal --image=dveselka/java-ee8-minimal
Get k8s pods
 kubectl get pods
NAME               READY   STATUS             RESTARTS   AGE
java-ee8-minimal   0/1     ImagePullBackOff   0          12s
Minikube running in Docker
$ docker ps
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS                                                                                                                                  NAMES
5f6397acb7e1        gcr.io/k8s-minikube/kicbase:v0.0.18   "/usr/local/bin/entr…"   21 hours ago        Up 22 minutes       127.0.0.1:32772->22/tcp, 127.0.0.1:32771->2376/tcp, 127.0.0.1:32770->5000/tcp, 127.0.0.1:32769->8443/tcp, 127.0.0.1:32768->32443/tcp   minikube

Start k8s dashboard
$ kubectl cluster-info 
Kubernetes control plane is running at https://172.17.0.2:8443
KubeDNS is running at https://172.17.0.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
[dave@dave java-ee8-minimal]$ minikube dashboard
🔌  Enabling dashboard ...
    ▪ Using image kubernetesui/dashboard:v2.1.0
    ▪ Using image kubernetesui/metrics-scraper:v1.0.4
🤔  Verifying dashboard health ...
🚀  Launching proxy ...
🤔  Verifying proxy health ...
🎉  Opening http://127.0.0.1:43609/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...

Forward k8s port to host
$ kubectl port-forward java-ee8-minimal 9990:9990
Forwarding from 127.0.0.1:9990 -> 9990
Forwarding from [::1]:9990 -> 9990
Handling connection for 9990

Check connection to app
$ wget http://localhost:8080/
--2021-03-14 17:28:48--  http://localhost:8080/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1504 (1.5K) [text/html]
Saving to: ‘index.html’

Call application resource
 curl http://localhost:8080/java-ee8-minimal/resources/ping
Enjoy Jakarta EE with MicroProfile 2+
Minikube dashboard with pod
Create deployment on k8s cluster
$ kubectl apply -f app.yml 
deployment.apps/java-ee8-minimal created
[dave@dave java-ee8-minimal]$ kubectl get pods
NAME                                READY   STATUS              RESTARTS   AGE
java-ee8-minimal-76cd57679d-l5smd   0/1     ContainerCreating   0          3s
java-ee8-minimal-76cd57679d-swvcd   0/1     ContainerCreating   0          3s

k8s deployment https://github.com/dveselka/java-ee-8/blob/main/java-ee8-minimal/app.yml
 more app.yml 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: java-ee8-minimal
spec:
  selector:
    matchLabels:
      app: java-ee8
  replicas: 2 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: java-ee8
    spec:
      containers:
      - name: java-ee8-minimal
        image: dveselka/java-ee8-minimal
        ports:
        - containerPort: 8080

Check pods
[dave@dave java-ee8-minimal]$ kubectl get pods -l app=java-ee8 -o wide
NAME                                READY   STATUS    RESTARTS   AGE     IP           NODE       NOMINATED NODE   READINESS GATES
java-ee8-minimal-76cd57679d-l5smd   1/1     Running   0          3m35s   172.18.0.5   minikube   <none>           <none>
java-ee8-minimal-76cd57679d-swvcd   1/1     Running   0          3m35s   172.18.0.6   minikube   <none>           <none>

Export port - service https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/
dave@dave java-ee8-minimal]$ kubectl expose deployment/java-ee8-minimal
service/java-ee8-minimal exposed
[dave@dave java-ee8-minimal]$ curl 172.18.0.5:8080
curl: (7) Failed to connect to 172.18.0.5 port 8080: No route to host
[dave@dave java-ee8-minimal]$ kubectl get pods -l app=java-ee8 -o wide |grep podIP
[dave@dave java-ee8-minimal]$ kubectl get pods -l app=java-ee8 -o wide 
NAME                                READY   STATUS    RESTARTS   AGE     IP           NODE       NOMINATED NODE   READINESS GATES
java-ee8-minimal-76cd57679d-l5smd   1/1     Running   0          5m28s   172.18.0.5   minikube   <none>           <none>
java-ee8-minimal-76cd57679d-swvcd   1/1     Running   0          5m28s   172.18.0.6   minikube   <none>           <none>
[dave@dave java-ee8-minimal]$ kubectl get svc java-ee8-minimal
NAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
java-ee8-minimal   ClusterIP   10.103.186.17   <none>        8080/TCP   35s
[dave@dave java-ee8-minimal]$ kubectl get svc java-ee8-minimal
NAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
java-ee8-minimal   ClusterIP   10.103.186.17   <none>        8080/TCP   40s
[dave@dave java-ee8-minimal]$ kubectl get ep java-ee8-minimal
NAME               ENDPOINTS                         AGE
java-ee8-minimal   172.18.0.5:8080,172.18.0.6:8080   61s
[dave@dave java-ee8-minimal]$ curl 172.18.0.5:8080/java-ee8-minimal/resources/ping
curl: (7) Failed to connect to 172.18.0.5 port 8080: No route to host
[dave@dave java-ee8-minimal]$ kubectl exec my-nginx-3800858182-jr4a2 -- printenv | grep SERVICE^C
[dave@dave java-ee8-minimal]$ kubectl get pods
NAME                                READY   STATUS    RESTARTS   AGE
java-ee8-minimal-76cd57679d-l5smd   1/1     Running   0          7m18s
java-ee8-minimal-76cd57679d-swvcd   1/1     Running   0          7m18s
[dave@dave java-ee8-minimal]$ kubectl exec java-ee8-minimal-76cd57679d-l5smd -- printenv | grep SERVICE
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_SERVICE_HOST=10.96.0.1
[dave@dave java-ee8-minimal]$ kubectl get services kube-dns --namespace=kube-system
NAME       TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
kube-dns   ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   26h
[dave@dave java-ee8-minimal]$ kubectl run curl --image=radial/busyboxplus:curl -i --tty
If you don't see a command prompt, try pressing enter.
[ root@curl:/ ]$ nslookup  java-ee8-minimal
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

nslookup: can't resolve 'java-ee8-minimal'
[ root@curl:/ ]$ curl 172.18.0.5:8080/java-ee8-minimal/resources/ping

Add ingress https://kubernetes.io/docs/concepts/services-networking/ingress/ https://github.com/dveselka/java-ee-8/blob/main/java-ee8-minimal/ingress.yaml
$ kubectl apply -f ingress.yaml 
ingress.networking.k8s.io/java-ee8-ingress configured
[dave@dave java-ee8-minimal]$ kubectl describe ingress  java-ee8-ingress
Name:             java-ee8-ingress
Namespace:        default
Address:          
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
  Host        Path  Backends
  ----        ----  --------
  *           
              /java-ee8-minimal   java-ee8-minimal:8080 (172.18.0.5:8080,172.18.0.6:8080)
Annotations:  nginx.ingress.kubernetes.io/rewrite-target: /
Events:       <none>

SSH into container inside k8s cluster

[dave@dave java-ee8-minimal]$ kubectl get pods
NAME                                READY   STATUS    RESTARTS   AGE
curl                                1/1     Running   1          3h49m
java-ee8-minimal-76cd57679d-l5smd   1/1     Running   0          3h58m
java-ee8-minimal-76cd57679d-swvcd   1/1     Running   0          3h58m
[dave@dave java-ee8-minimal]$ kubectl exec --stdin --tty java-ee8-minimal-76cd57679d-l5smd  -- /bin/bash
[jboss@java-ee8-minimal-76cd57679d-l5smd ~]$ curl localhost:8080/java-ee8-minimal/resources/ping
Enjoy Jakarta EE with MicroProfile 2+!
Add JBOss Wildfly admin user
[jboss@java-ee8-minimal-76cd57679d-l5smd ~]$ cd wildfly/
[jboss@java-ee8-minimal-76cd57679d-l5smd wildfly]$ ls
LICENSE.txt  README.txt  appclient  bin  copyright.txt  docs  domain  jboss-modules.jar  modules  standalone  welcome-content
[jboss@java-ee8-minimal-76cd57679d-l5smd wildfly]$ cd bin
[jboss@java-ee8-minimal-76cd57679d-l5smd bin]$ ./add-user.sh

What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a): 

Access Wildfly admin console Forward admin port
$ kubectl port-forward  java-ee8-minimal-76cd57679d-l5smd 9990:9990
Forwarding from 127.0.0.1:9990 -> 9990
Forwarding from [::1]:9990 -> 9990
Handling connection for 9990

Access console via browser using
http://localhost:9990/console
Access JBoss using minikube service
$ minikube service java-ee8-service
|-----------|------------------|-------------|-------------------------|
| NAMESPACE |       NAME       | TARGET PORT |           URL           |
|-----------|------------------|-------------|-------------------------|
| default   | java-ee8-service |        8080 | http://172.17.0.2:30919 |
|-----------|------------------|-------------|-------------------------|
🎉  Opening service default/java-ee8-service in default browser...

Instance running at http://172.17.0.2:30919/
$ wget -O - http://172.17.0.2:30919 
--2021-03-20 09:33:06--  http://172.17.0.2:30919/
Connecting to 172.17.0.2:30919... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1504 (1.5K) [text/html]
Saving to: ‘STDOUT’

-                                         0%[                                                                                ]       0  --.-KB/s               <!DOCTYPE html>

<html>
<head>
    <!-- proper charset -->
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

    <title>Welcome to WildFly</title>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="StyleSheet" href="wildfly.css" type="text/css">
</head>

<body>
<div class="wrapper">
    <div class="content">
        <div class="logo">
                <img src="wildfly_logo.png" alt="WildFly" border="0" />
        </div>
        <h1>Welcome to WildFly</h1>

        <h3>Your WildFly instance is running.</h3>

        <p><a href="https://docs.wildfly.org">Documentation</a> | <a href="https://github.com/wildfly/quickstart">Quickstarts</a> | <a href="/console">Administration
            Console</a> </p>

        <p><a href="https://wildfly.org">WildFly Project</a> |
            <a href="https://community.jboss.org/en/wildfly">User Forum</a> |
            <a href="https://issues.jboss.org/browse/WFLY">Report an issue</a></p>
        <p class="logos"><a href="https://www.jboss.org"><img src="jbosscommunity_logo_hori_white.png" alt="JBoss and JBoss Community" width=
                "195" height="37" border="0"></a></p>

        <p class="note">To replace this page simply deploy your own war with / as its context path.<br />
            To disable it, remove the "welcome-content" handler for location / in the undertow subsystem.</p>
    </div>
</div>
</body>
</html>
-                                       100%[===============================================================================>]   1.47K  --.-KB/s    in 0s      

2021-03-20 09:33:06 (36.7 MB/s) - written to stdout [1504/1504]

Weblogic Kubernetes Operator

HOWTO

 

GitHub repos

See latest updates here https://danielveselka.blogspot.com/2023/11/weblogic-kubernetes-k8s-operator.html

Saturday, February 13, 2021

Docker network between standalone containers

 HOWTO

 

GitHub repo

https://github.com/dveselka/weblogic/tree/master/docker-compose-managed-server

Containers

 

 docker ps
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                                            NAMES
bb6155b895af        12214-weblogic-domain-generic   "/u01/oracle/contain…"   3 minutes ago       Up 3 minutes        0.0.0.0:8001->8001/tcp                           managedserver
edc43bd0ce1c        12214-weblogic-domain-generic   "/u01/oracle/contain…"   3 minutes ago       Up 3 minutes        0.0.0.0:7001->7001/tcp, 0.0.0.0:9002->9002/tcp   adminserver

 

 Ping adminserver by hostname from managed server

$ docker exec -it managedserver /bin/bash
[oracle@bb6155b895af ~]$ ping adminserver
PING adminserver (172.19.0.2) 56(84) bytes of data.
64 bytes from adminserver.docker-compose-managed-server_wlsnet (172.19.0.2): icmp_seq=1 ttl=64 time=0.143 ms
64 bytes from adminserver.docker-compose-managed-server_wlsnet (172.19.0.2): icmp_seq=2 ttl=64 time=0.126 ms

Docker networks

 

[dave@dave ~]$ docker network ls
NETWORK ID          NAME                                   DRIVER              SCOPE
f52862010f16        bridge                                 bridge              local
4d18d28369b0        docker-compose-managed-server_wlsnet   bridge              local
fc58b29d0364        docker-compose_wlsnet                  bridge              local
f17fcc698c57        host                                   host                local
17497f49dcb2        none                                   null                local

 

Docker network for Weblogic servers

[dave@dave ~]$ docker inspect docker-compose-managed-server_wlsnet
[
    {
        "Name": "docker-compose-managed-server_wlsnet",
        "Id": "4d18d28369b0ec5dae676239ab95a3f64a2389091f0b47929aec9ca19e4b958b",
        "Created": "2021-02-13T08:46:13.300367764+01:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.19.0.0/16",
                    "Gateway": "172.19.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "bb6155b895af6f96341d1526d6e08597b3aab2156e29e1b8f90f980b44f0d198": {
                "Name": "managedserver",
                "EndpointID": "455729a26be89f9d37dde62a8b4b8e8a8fccfe248ee2425e574fb6f82ffa7ecb",
                "MacAddress": "02:42:ac:13:00:03",
                "IPv4Address": "172.19.0.3/16",
                "IPv6Address": ""
            },
            "edc43bd0ce1cee7f9d1b9cc9a32b9868396794a9b0e6ab32196ac32aec04ac31": {
                "Name": "adminserver",
                "EndpointID": "3744588006fc91c958625a115b2db839fe7dd5c601f774d9b648d717ba300dd9",
                "MacAddress": "02:42:ac:13:00:02",
                "IPv4Address": "172.19.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "wlsnet",
            "com.docker.compose.project": "docker-compose-managed-server",
            "com.docker.compose.version": "1.27.4"
        }
    }
]

Weblogic servers

Sunday, February 7, 2021

Create Weblogic Docker domain with managed server using Docker compose

HOWTO

* Weblogic Docker image using Centos  https://danielveselka.blogspot.com/2021/02/create-oracle-weblogic-docker-images.html

* Docker compose https://danielveselka.blogspot.com/2020/10/create-weblogic-docker-domain-using.html

* Docker compose reference https://docs.docker.com/compose/reference/overview/ 

GitHub repo https://github.com/dveselka/weblogic/tree/master/docker-compose-managed-server 

 


 

Docker file for Weblogic domain

https://github.com/dveselka/weblogic/blob/master/docker-compose-managed-server/Dockerfile

FROM oracle/weblogic:12.2.1.4-generic

# Maintainer
# ----------
MAINTAINER Daniel Veselka

# WLS Configuration
# -----------------
ENV CUSTOM_DOMAIN_NAME="${CUSTOM_DOMAIN_NAME:-daveDomain}" \
    CUSTOM_DOMAIN_ROOT="/app/domains" \
    CUSTOM_ADMIN_PORT="${CUSTOM_ADMIN_PORT:-7001}" \
    CUSTOM_ADMIN_NAME="${CUSTOM_ADMIN_NAME:-adminserver}" \
    CUSTOM_ADMIN_HOST="${CUSTOM_ADMIN_HOST:-adminserver}" \
    CUSTOM_MANAGED_SERVER_PORT="${CUSTOM_MANAGED_SERVER_PORT:-8001}" \
    CUSTOM_MANAGED_SERVER_NAME_BASE="${CUSTOM_MANAGED_SERVER_NAME_BASE:-MS}" \
    CUSTOM_CONFIGURED_MANAGED_SERVER_COUNT="${CUSTOM_CONFIGURED_MANAGED_SERVER_COUNT:-2}" \
    CUSTOM_MANAGED_NAME="${CUSTOM_MANAGED_NAME:-MS1}" \
    CUSTOM_CLUSTER_NAME="${CUSTOM_CLUSTER_NAME:-cluster1}" \
    CUSTOM_CLUSTER_TYPE="${CUSTOM_CLUSTER_TYPE:-DYNAMIC}" \
    CUSTOM_PRODUCTION_MODE_ENABLED="${CUSTOM_PRODUCTION_MODE_ENABLED:-prod}" \
    PROPERTIES_FILE_DIR="/app/domains/properties" \
    CUSTOM_JAVA_OPTIONS="-Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true"  \
    CUSTOM_PATH="$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/container-scripts"

# Add files required to build this image
COPY --chown=oracle:oracle container-scripts/* /u01/oracle/container-scripts/

#Create directory where domain will be written to
USER root
RUN mkdir -p $CUSTOM_DOMAIN_ROOT && \
    chown -R oracle:oracle $CUSTOM_DOMAIN_ROOT/.. && \
    chmod -R a+xwr $CUSTOM_DOMAIN_ROOT/.. && \
    chmod +x /u01/oracle/container-scripts/*

RUN ln -s  /usr/java/latest/ /usr/java/jdk-8

USER oracle

VOLUME $CUSTOM_DOMAIN_ROOT

WORKDIR $ORACLE_HOME
CMD ["/u01/oracle/container-scripts/createWLSDomain.sh"]


Domain script modified to take values from env vars https://github.com/dveselka/weblogic/blob/master/docker-compose-managed-server/container-scripts/create-wls-domain.py

import os
import socket

def getEnvVar(var):
  val=os.environ.get(var)
  if val==None:
    print "ERROR: Env var ",var, " not set."
    sys.exit(1)
  return val

# This python script is used to create a WebLogic domain
domain_name                   = getEnvVar("CUSTOM_DOMAIN_NAME")
admin_server_name             = os.environ.get("CUSTOM_ADMIN_NAME")
admin_port                    = int(os.environ.get("CUSTOM_ADMIN_PORT"))
server_port                   = int(os.environ.get("CUSTOM_MANAGED_SERVER_PORT"))
managed_server_name_base      = os.environ.get("CUSTOM_MANAGED_SERVER_NAME_BASE")
number_of_ms                  = int(os.environ.get("CUSTOM_CONFIGURED_MANAGED_SERVER_COUNT"))
domain_path                   = os.environ.get("CUSTOM_DOMAIN_HOME")
cluster_name                  = os.environ.get("CUSTOM_CLUSTER_NAME")
cluster_type                  = os.environ.get("CUSTOM_CLUSTER_TYPE")
production_mode_enabled       = os.environ.get("CUSTOM_PRODUCTION_MODE_ENABLED")

username = getEnvVar("CUSTOM_WEBLOGIC_USERNAME")
password = getEnvVar("CUSTOM_WEBLOGIC_PASSWORD")

Docker compose file https://github.com/dveselka/weblogic/blob/master/docker-compose-managed-server/docker-compose.yml

 

version: "3.8"

networks:
  &network wlsnet:
    driver: bridge

services:
  adminserver:
    container_name: adminserver
    hostname: adminserver
    image: 12214-weblogic-domain-generic
    restart: "no" 
    environment:
      JAVA_HOME: "/usr/java/latest"
      CUSTOM_PRODUCTION_MODE_ENABLED: "false"
      CUSTOM_DOMAIN_NAME: daveDomain
      CUSTOM_DOMAIN_ROOT: /app/domains
      CUSTOM_DOMAIN_HOME: /app/domains/daveDomain
      CUSTOM_WEBLOGIC_USERNAME: weblogic
      CUSTOM_WEBLOGIC_PASSWORD: weblogic123
    ports:
      - "7001:7001"
      - "9002:9002"
    networks:
      - *network
    volumes:
      - /app/domains:/app/domains:z


  managedserver:
    container_name: managedserver    
    image: 12214-weblogic-domain-generic
    command: /u01/oracle/container-scripts/startManagedServer.sh 
    restart: "no" 
    environment:
      JAVA_HOME: "/usr/java/latest"
      CUSTOM_PRODUCTION_MODE_ENABLED: "false"
      CUSTOM_DOMAIN_HOME: /app/domains/daveDomain
      CUSTOM_WEBLOGIC_USERNAME: weblogic
      CUSTOM_WEBLOGIC_PASSWORD: weblogic123
    ports:
      - "8001:8001"
    depends_on:
      - adminserver

    networks:
      - *network
    volumes:
      - /app/domains:/app/domains:z  

 
Logs from Docker compose

[dave@dave docker-compose-managed-server]$ docker-compose up
Creating AdminContainer ... done
Creating managedserver  ... done
Attaching to AdminContainer, managedserver
managedserver    | Domain Home is:  /u01/oracle/user_projects/domains/base_domain
AdminContainer   | Domain Home is:  /u01/oracle/user_projects/domains/base_domain
AdminContainer   | /u01/oracle/properties/domain_security.properties
managedserver    | Waiting for WebLogic Admin Server on AdminContainer/7001 to become available...
AdminContainer   | /u01/oracle/properties/domain.properties
AdminContainer   | Java Options: -Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true
AdminContainer   | Starting the Admin Server
AdminContainer   | ==========================
AdminContainer   | .
AdminContainer   | .
AdminContainer   | JAVA Memory arguments: -Djava.security.egd=file:/dev/./urandom
AdminContainer   | .
AdminContainer   | CLASSPATH=/usr/java/jdk-8/lib/tools.jar:/u01/oracle/wlserver/server/lib/weblogic.jar:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/u01/oracle/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/u01/oracle/wlserver/common/derby/lib/derbynet.jar:/u01/oracle/wlserver/common/derby/lib/derbyclient.jar:/u01/oracle/wlserver/common/derby/lib/derby.jar
AdminContainer   | .
AdminContainer   | PATH=/u01/oracle/user_projects/domains/base_domain/bin:/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/usr/java/jdk-8/jre/bin:/usr/java/jdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
AdminContainer   | .
AdminContainer   | ***************************************************
AdminContainer   | *  To start WebLogic Server, use a username and   *
AdminContainer   | *  password assigned to an admin-level user.  For *
AdminContainer   | *  server administration, use the WebLogic Server *
AdminContainer   | *  console at http://hostname:port/console        *
AdminContainer   | ***************************************************
AdminContainer   | Starting WLS with line:
AdminContainer   | /usr/java/jdk-8/bin/java -server   -Djava.security.egd=file:/dev/./urandom -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy  -Dweblogic.ProductionModeEnabled=true -Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader  -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server      weblogic.Server
AdminContainer   | <Feb 7, 2021 1:53:32 PM UTC> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.> 
AdminContainer   | <Feb 7, 2021 1:53:32 PM UTC> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.> 
AdminContainer   | <Feb 7, 2021 1:53:33 PM UTC> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.231-b11 from Oracle Corporation.> 
AdminContainer   | <Feb 7, 2021 1:53:33 PM UTC> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.> 
AdminContainer   | <Feb 7, 2021 1:53:33 PM UTC> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.2.1.4.0 Thu Sep 12 04:04:29 GMT 2019 1974621> 
AdminContainer   | <Feb 7, 2021 1:53:34 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
AdminContainer   | <Feb 7, 2021 1:53:34 PM UTC> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.> 
AdminContainer   | <Feb 7, 2021 1:53:34 PM UTC> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.> 
AdminContainer   | <Feb 7, 2021 1:53:35,054 PM UTC> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=1372879917
AdminContainer   | Current log file=/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log
AdminContainer   | Rotation dir=/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs
AdminContainer   |  is opened. All server side log events will be written to this file.> 
AdminContainer   | <Feb 7, 2021 1:53:35,538 PM UTC> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm> 
AdminContainer   | <Feb 7, 2021 1:53:35,911 PM UTC> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm> 
AdminContainer   | <Feb 7, 2021 1:53:37,147 PM UTC> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm> 
AdminContainer   | <Feb 7, 2021 1:53:37,580 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.19.0.2:7001/jndi/weblogic.management.mbeanservers.runtime.> 
AdminContainer   | <Feb 7, 2021 1:53:37,942 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.19.0.2:7001/jndi/weblogic.management.mbeanservers.domainruntime.> 
AdminContainer   | <Feb 7, 2021 1:53:38,007 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.19.0.2:7001/jndi/weblogic.management.mbeanservers.edit.> 
AdminContainer   | <Feb 7, 2021 1:53:38,738 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.> 
AdminContainer   | <Feb 7, 2021 1:53:38,738 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
AdminContainer   | <Feb 7, 2021 1:53:38,776 PM UTC> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.> 
AdminContainer   | <Feb 7, 2021 1:53:40,767 PM UTC> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.> 
AdminContainer   | <Feb 7, 2021 1:53:41,489 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.> 
AdminContainer   | <Feb 7, 2021 1:53:41,543 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.> 
AdminContainer   | <Feb 7, 2021 1:53:41,580 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 172.19.0.2:7001 for protocols iiop, t3, ldap, snmp, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,648 PM UTC> <Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under the alias DemoIdentity from the jks keystore file /u01/oracle/user_projects/domains/base_domain/security/DemoIdentity.jks.> 
AdminContainer   | <Feb 7, 2021 1:53:41,654 PM UTC> <Alert> <Security> <BEA-090153> <Demo identity certificate is used in 
AdminContainer   | <Feb 7, 2021 1:53:41,656 PM UTC> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /u01/oracle/wlserver/server/lib/DemoTrust.jks.> 
AdminContainer   | <Feb 7, 2021 1:53:41,658 PM UTC> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /usr/java/jdk1.8.0_231-amd64/jre/lib/security/cacerts.> 
AdminContainer   | <Feb 7, 2021 1:53:41,663 PM UTC> <Alert> <Security> <BEA-090152> <Demo trusted CA certificate is being used in 
AdminContainer   | <Feb 7, 2021 1:53:41,666 PM UTC> <Notice> <WebLogicServer> <BEA-000329> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in production mode.> 
AdminContainer   | <Feb 7, 2021 1:53:41,666 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on 172.19.0.2:7002 for protocols iiops, t3s, ldaps, https.> 
AdminContainer   | <Feb 7, 2021 1:53:41,667 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[1]" is now listening on 127.0.0.1:7002 for protocols iiops, t3s, ldaps, https.> 
AdminContainer   | <Feb 7, 2021 1:53:41,667 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,668 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel" is now listening on 172.19.0.2:8001 for protocols t3, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,668 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel[1]" is now listening on 127.0.0.1:8001 for protocols t3, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,669 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 172.19.0.2:7001 for protocols iiop, t3, ldap, snmp, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,669 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on 172.19.0.2:7002 for protocols iiops, t3s, ldaps, https.> 
AdminContainer   | <Feb 7, 2021 1:53:41,670 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[1]" is now listening on 127.0.0.1:7002 for protocols iiops, t3s, ldaps, https.> 
AdminContainer   | <Feb 7, 2021 1:53:41,670 PM UTC> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.> 
AdminContainer   | <Feb 7, 2021 1:53:41,671 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,672 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel" is now listening on 172.19.0.2:8001 for protocols t3, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,673 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel[1]" is now listening on 127.0.0.1:8001 for protocols t3, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,677 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 
managedserver    | WebLogic Admin Server is now available. Proceeding...
managedserver    | Managed Server Name: MS1
managedserver    | Managed Server Home: /u01/oracle/user_projects/domains/base_domain/servers/MS1
managedserver    | Managed Server Security: /u01/oracle/user_projects/domains/base_domain/servers/MS1/security
managedserver    | A properties file with the username and password needs to be supplied.
managedserver exited with code 0
AdminContainer   | 2021-02-07 13:53:42.756/11.265 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "jar:file:/u01/oracle/coherence/lib/coherence.jar!/tangosol-coherence.xml"
AdminContainer   | 2021-02-07 13:53:42.797/11.306 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "jar:file:/u01/oracle/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
AdminContainer   | 2021-02-07 13:53:42.801/11.310 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
AdminContainer   | 2021-02-07 13:53:42.805/11.315 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "cache-factory-config.xml" is not specified
AdminContainer   | 2021-02-07 13:53:42.808/11.318 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "cache-factory-builder-config.xml" is not specified
AdminContainer   | 2021-02-07 13:53:42.811/11.320 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
AdminContainer   | 
AdminContainer   | Oracle Coherence Version 12.2.1.4.0 Build 74888
AdminContainer   |  Grid Edition: Development mode
AdminContainer   | Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
AdminContainer   | 
AdminContainer   | 2021-02-07 13:53:42.888/11.397 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Configured versioned, multi-cluster Management over ReST
AdminContainer   | <Feb 7, 2021 1:54:11,563 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Initializing callbacks> 
AdminContainer   | <Feb 7, 2021 1:54:11,566 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Added MBeanServerConnection in DomainRuntimeServiceMBean > 
AdminContainer   | <Feb 7, 2021 1:54:11,567 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Callback is done> 
AdminContainer   | <Feb 7, 2021 1:54:11,570 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Connection already exists for the server. Did not attempt to connect to the server> 
AdminContainer   | <Feb 7, 2021 1:54:13,054 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=All Servers : Resolving connection list DomainRuntimeServiceMBean> 

Managed server start

dminserver      | <Feb 13, 2021 8:14:44,392 AM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 
managedserver    | WebLogic Admin Server is now available. Proceeding...
managedserver    | Managed Server Name: MS1
managedserver    | Managed Server Home: /app/domains/daveDomain/servers/MS1
managedserver    | Managed Server Security: /app/domains/daveDomain/servers/MS1/security
managedserver    | Make directory /app/domains/daveDomain/servers/MS1/security to create boot.properties
managedserver    | Java Options: -Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true
managedserver    | Connecting to Admin Server at http://adminserver:7001
managedserver    | .
managedserver    | .
managedserver    | JAVA Memory arguments: -Djava.security.egd=file:/dev/./urandom
managedserver    | .
managedserver    | CLASSPATH=/usr/java/jdk1.8.0_231-amd64/lib/tools.jar:/u01/oracle/wlserver/server/lib/weblogic.jar:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/u01/oracle/wlserver/modules/features/oracle.wls.common.nodemanager.jar:/u01/oracle/wlserver/common/derby/lib/derbyclient.jar:/u01/oracle/wlserver/common/derby/lib/derby.jar
managedserver    | .
managedserver    | PATH=/app/domains/daveDomain/bin:/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/usr/java/jdk1.8.0_231-amd64/jre/bin:/usr/java/jdk1.8.0_231-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
managedserver    | .
managedserver    | ***************************************************
managedserver    | *  To start WebLogic Server, use a username and   *
managedserver    | *  password assigned to an admin-level user.  For *
managedserver    | *  server administration, use the WebLogic Server *
managedserver    | *  console at http://hostname:port/console        *
managedserver    | ***************************************************
managedserver    | Starting WLS with line:
managedserver    | /usr/java/jdk1.8.0_231-amd64/bin/java -server   -Djava.security.egd=file:/dev/./urandom -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=MS1 -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader  -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server   -Dweblogic.management.server=http://adminserver:7001   weblogic.Server
adminserver      | 2021-02-13 08:14:45.918/7.656 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "jar:file:/u01/oracle/coherence/lib/coherence.jar!/tangosol-coherence.xml"

Create Oracle Weblogic Docker image using Centos 8

 HOWTO

 

GitHub repo

 

Docker file

On Centos add link to JDK
RUN ln -s  /usr/java/latest/ /usr/java/jdk-8

 

[dave@dave docker-weblogic-centos-8]$ more Dockerfile.generic 
#Copyright (c) 2014-2019 Oracle and/or its affiliates. All rights reserved.
#
#Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This is the Dockerfile for Oracle WebLogic Server 12.2.1.4 Generic Distro
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# (1) fmw_12.2.1.4.0_wls_Disk1_1of1.zip
#     Download the Generic installer from http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html
#
# (2) server-jre-8uXX-linux-x64.tar.gz
#     Download from http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
#      $ docker build -f Dockerfile.generic -t oracle/weblogic:12.2.1.4-generic .
#
# IMPORTANT
# ---------
# The resulting image of this Dockerfile contains a WLS Empty Domain.
#
# From the OIracle Docker GitHub Project
# --------------------------------------
FROM dveselka/oracle-jdk-8 as builder

# Maintainer
# ----------
MAINTAINER Daniel Veselka

# Common environment variables required for this build (do NOT change)
# --------------------------------------------------------------------
ENV ORACLE_HOME=/u01/oracle \
    JAVA_HOME=/usr/java/latest \
    USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
    PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin

# Setup filesystem and oracle user
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
# ------------------------------------------------------------
RUN mkdir -p /u01 && \
    chmod a+xr /u01 && \
    useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle

# Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
ENV FMW_PKG=fmw_12.2.1.4.0_wls_Disk1_1of1.zip \
    FMW_JAR=fmw_12.2.1.4.0_wls.jar

# Copy packages
# -------------
COPY $FMW_PKG install.file oraInst.loc /u01/
RUN chown oracle:oracle -R /u01

# Install
# ------------------------------------------------------------
USER oracle

RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \
    ${JAVA_HOME}/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="WebLogic Server" &&
 \
    rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file && \
    rm -rf /u01/oracle/cfgtoollogs

# Final image stage
FROM dveselka/oracle-jdk-8

ENV ORACLE_HOME=/u01/oracle \
    USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
    SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
    PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin

# Domain and Server environment variables
# ------------------------------------------------------------
ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
    ADMIN_LISTEN_PORT="${ADMIN_LISTEN_PORT:-7001}" \
    ADMIN_NAME="${ADMIN_NAME:-AdminServer}" \
    ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}" \
    ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}"

# Setup filesystem and oracle user
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
# ------------------------------------------------------------
RUN mkdir -p /u01 && \
    chmod a+xr /u01 && \
    useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle

COPY --from=builder --chown=oracle:oracle /u01 /u01

# Copy scripts
#-------------
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/

RUN chmod +xr $SCRIPT_FILE && \
    chown oracle:oracle -R /u01/oracle/createAndStartEmptyDomain.sh && \
    chown oracle:oracle -R /u01/oracle/create-wls-domain.py
    
RUN ln -s  /usr/java/latest/ /usr/java/jdk-8

USER oracle

WORKDIR ${ORACLE_HOME}

# Define default command to start script.
CMD ["/u01/oracle/createAndStartEmptyDomain.sh"]

Build image
[dave@dave docker-weblogic-centos-8]$ ./buildDockerImage.sh  -g -v 12.2.1.4
Checking if required packages are present and valid...
fmw_12.2.1.4.0_wls_Disk1_1of1.zip: OK
md5sum: WARNING: 1 line is improperly formatted
=====================
Building image 'oracle/weblogic:12.2.1.4-generic' ...
Sending build context to Docker daemon  866.5MB
Step 1/19 : FROM dveselka/oracle-jdk-8 as builder
 ---> bec32556adc7
Step 2/19 : MAINTAINER Daniel Veselka
 ---> Running in af3cef73329d
Removing intermediate container af3cef73329d
 ---> b93016858b03
Step 3/19 : ENV ORACLE_HOME=/u01/oracle     JAVA_HOME=/usr/java/latest     USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom"     PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
 ---> Running in 63b3777a9040
Removing intermediate container 63b3777a9040
 ---> 82fb7b7cd6e8
Step 4/19 : RUN mkdir -p /u01 &&     chmod a+xr /u01 &&     useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle
 ---> Running in 63ba70aa9b9a
Removing intermediate container 63ba70aa9b9a
 ---> a4b954c717e1
Step 5/19 : ENV FMW_PKG=fmw_12.2.1.4.0_wls_Disk1_1of1.zip     FMW_JAR=fmw_12.2.1.4.0_wls.jar
 ---> Running in 5b7fb0593599
Removing intermediate container 5b7fb0593599
 ---> 3447bba4b718
Step 6/19 : COPY $FMW_PKG install.file oraInst.loc /u01/
 ---> 09f0542931f2
Step 7/19 : RUN chown oracle:oracle -R /u01
 ---> Running in 8413ad11f113
Removing intermediate container 8413ad11f113
 ---> b8a2c7bb0114
Step 8/19 : USER oracle
 ---> Running in 75fa0ca56981
Removing intermediate container 75fa0ca56981
 ---> 6c85ed12d882
Step 9/19 : RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - &&     ${JAVA_HOME}/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="WebLogic Server" &&     rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file &&     rm -rf /u01/oracle/cfgtoollogs
 ---> Running in 07ef1bdaf763
/
Launcher log file is /tmp/OraInstall2021-02-07_11-34-29AM/launcher2021-02-07_11-34-29AM.log.
Extracting the installer . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2731.381 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 8015 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 27309 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2021-02-07_11-34-29AM
Log: /tmp/OraInstall2021-02-07_11-34-29AM/install2021-02-07_11-34-29AM.log
Setting ORACLE_HOME...
Setting INSTALL_TYPE...
Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Validations are disabled for this session.
Verifying data
Copying Files
Percent Complete : 10
Percent Complete : 20
Percent Complete : 30
Percent Complete : 40
Percent Complete : 50
Percent Complete : 60
Percent Complete : 70
Percent Complete : 80
Percent Complete : 90
Percent Complete : 100

The installation of Oracle Fusion Middleware 12c WebLogic Server and Coherence 12.2.1.4.0 completed successfully.
Logs successfully copied to /u01/oracle/.inventory/logs.
Removing intermediate container 07ef1bdaf763
 ---> f0ae2aba0dfc
Step 10/19 : FROM dveselka/oracle-jdk-8
 ---> bec32556adc7
Step 11/19 : ENV ORACLE_HOME=/u01/oracle     USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom"     SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh     PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
 ---> Running in 1a6644809ac8
Removing intermediate container 1a6644809ac8
 ---> efe0fb8d544c
Step 12/19 : ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}"     ADMIN_LISTEN_PORT="${ADMIN_LISTEN_PORT:-7001}"     ADMIN_NAME="${ADMIN_NAME:-AdminServer}"     ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}"     ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}"
 ---> Running in dcfe279ce745
Removing intermediate container dcfe279ce745
 ---> a5727a8ccc86
Step 13/19 : RUN mkdir -p /u01 &&     chmod a+xr /u01 &&     useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle
 ---> Running in b7a8d369be07
Removing intermediate container b7a8d369be07
 ---> db8cd5ffd3cc
Step 14/19 : COPY --from=builder --chown=oracle:oracle /u01 /u01
 ---> 7c6cf0a33e7c
Step 15/19 : COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
 ---> ab295f4312d1
Step 16/19 : RUN chmod +xr $SCRIPT_FILE &&     chown oracle:oracle -R /u01/oracle/createAndStartEmptyDomain.sh &&     chown oracle:oracle -R /u01/oracle/create-wls-domain.py
 ---> Running in 591f7791b9ca
Removing intermediate container 591f7791b9ca
 ---> da623462c1b3
Step 17/19 : USER oracle
 ---> Running in 3992a4838297
Removing intermediate container 3992a4838297
 ---> 30090b2cc920
Step 18/19 : WORKDIR ${ORACLE_HOME}
 ---> Running in bfb4d92eea36
Removing intermediate container bfb4d92eea36
 ---> 5464d9a6c933
Step 19/19 : CMD ["/u01/oracle/createAndStartEmptyDomain.sh"]
 ---> Running in ee7f2ecb5dfb
Removing intermediate container ee7f2ecb5dfb
 ---> 6ca3e64b737c
Successfully built 6ca3e64b737c
Successfully tagged oracle/weblogic:12.2.1.4-generic

  WebLogic Docker Image for 'generic' version 12.2.1.4 is ready to be extended:

    --> oracle/weblogic:12.2.1.4-generic

  Build completed in 78 seconds.


Docker images

[dave@dave docker-weblogic-centos-8]$ docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
oracle/weblogic         12.2.1.4-generic    6ca3e64b737c        3 minutes ago       1.7GB
<none>                  <none>              f0ae2aba0dfc        3 minutes ago       3.43GB
<none>                  <none>              ac0fdf1fa66b        10 minutes ago      2.53GB
dveselka/oracle-jdk-8   latest              bec32556adc7        2 hours ago         799MB
centos                  8                   300e315adb2f        2 months ago        209MB

Start via Docker compose https://github.com/dveselka/weblogic/tree/master/docker-compose

[dave@dave docker-compose]$ docker-compose up
Recreating adminserver ... done
Attaching to adminserver
adminserver    | Domain Home is:  /u01/oracle/user_projects/domains/base_domain
adminserver    | .
adminserver    | .
adminserver    | JAVA Memory arguments: -Djava.security.egd=file:/dev/./urandom
adminserver    | .
adminserver    | CLASSPATH=/usr/java/jdk-8/lib/tools.jar:/u01/oracle/wlserver/server/lib/weblogic.jar:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/u01/oracle/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/u01/oracle/wlserver/common/derby/lib/derbynet.jar:/u01/oracle/wlserver/common/derby/lib/derbyclient.jar:/u01/oracle/wlserver/common/derby/lib/derby.jar
adminserver    | .
adminserver    | PATH=/u01/oracle/user_projects/domains/base_domain/bin:/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/usr/java/jdk-8/jre/bin:/usr/java/jdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
adminserver    | .
adminserver    | ***************************************************
adminserver    | *  To start WebLogic Server, use a username and   *
adminserver    | *  password assigned to an admin-level user.  For *
adminserver    | *  server administration, use the WebLogic Server *
adminserver    | *  console at http://hostname:port/console        *
adminserver    | ***************************************************
adminserver    | Starting WLS with line:
adminserver    | /usr/java/jdk-8/bin/java -server   -Djava.security.egd=file:/dev/./urandom -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy  -Dweblogic.ProductionModeEnabled=true  -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader  -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server      weblogic.Server
adminserver    | <Feb 7, 2021 12:11:14 PM UTC> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.> 
adminserver    | <Feb 7, 2021 12:11:14 PM UTC> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.> 
adminserver    | <Feb 7, 2021 12:11:15 PM UTC> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.231-b11 from Oracle Corporation.> 
adminserver    | <Feb 7, 2021 12:11:15 PM UTC> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.> 
adminserver    | <Feb 7, 2021 12:11:15 PM UTC> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.2.1.4.0 Thu Sep 12 04:04:29 GMT 2019 1974621> 
adminserver    | <Feb 7, 2021 12:11:16 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
adminserver    | <Feb 7, 2021 12:11:16 PM UTC> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.> 
adminserver    | <Feb 7, 2021 12:11:16 PM UTC> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.> 
adminserver    | <Feb 7, 2021 12:11:16,937 PM UTC> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=269987631
adminserver    | Current log file=/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log
adminserver    | Rotation dir=/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs
adminserver    |  is opened. All server side log events will be written to this file.> 
adminserver    | <Feb 7, 2021 12:11:17,340 PM UTC> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm> 
adminserver    | <Feb 7, 2021 12:11:17,742 PM UTC> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm> 
adminserver    | <Feb 7, 2021 12:11:19,068 PM UTC> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm> 
adminserver    | <Feb 7, 2021 12:11:19,491 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.18.0.2:7001/jndi/weblogic.management.mbeanservers.runtime.> 
adminserver    | <Feb 7, 2021 12:11:19,836 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.18.0.2:7001/jndi/weblogic.management.mbeanservers.domainruntime.> 
adminserver    | <Feb 7, 2021 12:11:19,905 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.18.0.2:7001/jndi/weblogic.management.mbeanservers.edit.> 
adminserver    | <Feb 7, 2021 12:11:20,635 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.> 
adminserver    | <Feb 7, 2021 12:11:20,636 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
adminserver    | <Feb 7, 2021 12:11:20,679 PM UTC> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.> 
adminserver    | <Feb 7, 2021 12:11:22,622 PM UTC> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.> 
adminserver    | <Feb 7, 2021 12:11:23,341 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.> 
adminserver    | <Feb 7, 2021 12:11:23,397 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.> 
adminserver    | <Feb 7, 2021 12:11:23,509 PM UTC> <Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under the alias DemoIdentity from the jks keystore file /u01/oracle/user_projects/domains/base_domain/security/DemoIdentity.jks.> 
adminserver    | <Feb 7, 2021 12:11:23,531 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[1]" is now listening on 127.0.0.1:7002 for protocols iiops, t3s, ldaps, https.> 
adminserver    | <Feb 7, 2021 12:11:23,532 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
adminserver    | <Feb 7, 2021 12:11:23,532 PM UTC> <Notice> <WebLogicServer> <BEA-000329> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in production mode.> 
adminserver    | <Feb 7, 2021 12:11:23,532 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 172.18.0.2:7001 for protocols iiop, t3, ldap, snmp, http.> 
adminserver    | <Feb 7, 2021 12:11:23,533 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on 172.18.0.2:7002 for protocols iiops, t3s, ldaps, https.> 
adminserver    | <Feb 7, 2021 12:11:23,533 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel[1]" is now listening on 127.0.0.1:8001 for protocols t3, http.> 
adminserver    | <Feb 7, 2021 12:11:23,534 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel" is now listening on 172.18.0.2:8001 for protocols t3, http.> 
adminserver    | <Feb 7, 2021 12:11:23,534 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[1]" is now listening on 127.0.0.1:7002 for protocols iiops, t3s, ldaps, https.> 
adminserver    | <Feb 7, 2021 12:11:23,535 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
adminserver    | <Feb 7, 2021 12:11:23,536 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 172.18.0.2:7001 for protocols iiop, t3, ldap, snmp, http.> 
adminserver    | <Feb 7, 2021 12:11:23,536 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on 172.18.0.2:7002 for protocols iiops, t3s, ldaps, https.> 
adminserver    | <Feb 7, 2021 12:11:23,537 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel[1]" is now listening on 127.0.0.1:8001 for protocols t3, http.> 
adminserver    | <Feb 7, 2021 12:11:23,537 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel" is now listening on 172.18.0.2:8001 for protocols t3, http.> 
adminserver    | <Feb 7, 2021 12:11:23,538 PM UTC> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.> 
adminserver    | <Feb 7, 2021 12:11:23,544 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 
adminserver    | 2021-02-07 12:11:24.695/11.197 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "jar:file:/u01/oracle/coherence/lib/coherence.jar!/tangosol-coherence.xml"
adminserver    | 2021-02-07 12:11:24.734/11.235 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "jar:file:/u01/oracle/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
adminserver    | 2021-02-07 12:11:24.737/11.239 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
adminserver    | 2021-02-07 12:11:24.741/11.243 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "cache-factory-config.xml" is not specified
adminserver    | 2021-02-07 12:11:24.744/11.246 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "cache-factory-builder-config.xml" is not specified
adminserver    | 2021-02-07 12:11:24.747/11.249 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
adminserver    | 
adminserver    | Oracle Coherence Version 12.2.1.4.0 Build 74888
adminserver    |  Grid Edition: Development mode
adminserver    | Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
adminserver    | 
adminserver    | 2021-02-07 12:11:24.818/11.320 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Configured versioned, multi-cluster Management over ReST

Create Centos 8 Oracle JDK Docker image

HOWTO

 

Download Oracle JDK RPM from https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

 

GitHub repo https://github.com/dveselka/weblogic/tree/master/docker-oracle-java-8

Docker file

 

[dave@dave docker-oracle-java-8]$ more Dockerfile 
FROM centos:8

ADD jdk-8u231-linux-x64.rpm jdk-8u231-linux-x64.rpm

RUN dnf -y  install jdk-8u231-linux-x64.rpm

 

 

Build Docker image 

[dave@dave docker-oracle-java-8]$ docker build -t dveselka/oracle-jdk-8 .
Sending build context to Docker daemon  178.6MB
Step 1/3 : FROM centos:8
 ---> 300e315adb2f
Step 2/3 : ADD jdk-8u231-linux-x64.rpm jdk-8u231-linux-x64.rpm
 ---> e08cec58130d
Step 3/3 : RUN dnf -y  install jdk-8u231-linux-x64.rpm
 ---> Running in edde270eb14b
CentOS Linux 8 - AppStream                      2.8 MB/s | 6.3 MB     00:02    
CentOS Linux 8 - BaseOS                         2.5 MB/s | 2.3 MB     00:00    
CentOS Linux 8 - Extras                          16 kB/s | 8.6 kB     00:00    
Dependencies resolved.
================================================================================
 Package      Architecture Version                     Repository          Size
================================================================================
Installing:
 jdk1.8       x86_64       2000:1.8.0_231-fcs          @commandline       170 M

Transaction Summary
================================================================================
Install  1 Package

Total size: 170 M
Installed size: 294 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : jdk1.8-2000:1.8.0_231-fcs.x86_64                       1/1 
  Running scriptlet: jdk1.8-2000:1.8.0_231-fcs.x86_64                       1/1 
Unpacking JAR files...
    tools.jar...
    plugin.jar...
    javaws.jar...
    deploy.jar...
    rt.jar...
    jsse.jar...
    charsets.jar...
    localedata.jar...

  Verifying        : jdk1.8-2000:1.8.0_231-fcs.x86_64                       1/1 

Installed:
  jdk1.8-2000:1.8.0_231-fcs.x86_64                                              

Complete!
Removing intermediate container edde270eb14b
 ---> bec32556adc7
Successfully built bec32556adc7
Successfully tagged dveselka/oracle-jdk-8:latest

 

Created image

 

[dave@dave docker-oracle-java-8]$ pwd
/git/weblogic/docker-oracle-java-8
[dave@dave docker-oracle-java-8]$ ls -1
Dockerfile
jdk-8u231-linux-x64.rpm
[dave@dave docker-oracle-java-8]$ docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
dveselka/oracle-jdk-8   latest              bec32556adc7        3 minutes ago       799MB

 

Java inside running container

 

[dave@dave docker-oracle-java-8]$ docker run -it dveselka/oracle-jdk-8
[root@f679c2746165 /]# java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

[root@f679c2746165 /]# ls -l /usr/java
total 4
lrwxrwxrwx. 1 root root   16 Feb  7 09:53 default -> /usr/java/latest
drwxr-xr-x. 8 root root 4096 Feb  7 09:53 jdk1.8.0_231-amd64
lrwxrwxrwx. 1 root root   28 Feb  7 09:53 latest -> /usr/java/jdk1.8.0_231-amd64
[root@f679c2746165 /]# more /etc/redhat-release 
CentOS Linux release 8.3.2011