Docker-images: WebLogic Docker container silently fails to start

Created on 6 Feb 2020  Â·  43Comments  Â·  Source: oracle/docker-images

docker run -d -p 7001:7001 -p 9002:9002 -v $PWD:/u01/oracle/properties store/oracle/weblogic:12.2.1.4
Unable to find image 'store/oracle/weblogic:12.2.1.4' locally
12.2.1.4: Pulling from store/oracle/weblogic
822ace0353cb: Pull complete
19841f86e7b5: Pull complete
b3c7d6d987c6: Pull complete
cc5da308016d: Pull complete
91c19f73b26d: Pull complete
afca886f8980: Pull complete
Digest: sha256:7f0cb6f693cc15c18ae279c30df8dbdda8073598cc09caab8f5f67ce150823d8
Status: Downloaded newer image for store/oracle/weblogic:12.2.1.4
f47e055898f6f7443a6bc9d02e7ee22246328fa8c61d0a93fea184dfcbeac392

Looks fine so far.. Let's see the running container:

docker ps                                                          
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                                            NAMES
f47e055898f6        store/oracle/weblogic:12.2.1.4   "/u01/oracle/createA…"   9 seconds ago       Up 8 seconds        0.0.0.0:7001->7001/tcp, 0.0.0.0:9002->9002/tcp   clever_curie 

Great, let's try to run a bash shell in the container:

docker exec -it f47e055898f6 /bin/bash                                        
Error response from daemon: Container f47e055898f6f7443a6bc9d02e7ee22246328fa8c61d0a93fea184dfcbeac392 is not running```

Ok, so the container exited in the 30 seconds that elapsed between running 'docker ps' and the command above. Below I have confirmation that the container exited, but I have no idea why.

Let's see the stopped container.

docker ps -a                                                                  
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS                      PORTS               NAMES
f47e055898f6        store/oracle/weblogic:12.2.1.4   "/u01/oracle/createA…"   53 seconds ago      Exited (1) 39 seconds ago                       clever_curie```
docker logs -f f47e055898f6                                                     
Domain Home is:  /u01/oracle/user_projects/domains/

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

domain_name                 : [base_domain]
admin_listen_port           : [7001]
domain_path                 : [/u01/oracle/user_projects/domains/base_domain]
production_mode             : [prod]
admin name                  : [AdminServer]
administration_port_enabled : [true]
administration_port         : [9002]


Exiting WebLogic Scripting Tool.

/u01/oracle/createAndStartEmptyDomain.sh: line 66: /u01/oracle/user_projects/domains//bin/setDomainEnv.sh: No such file or directory
/u01/oracle/createAndStartEmptyDomain.sh: line 70: /u01/oracle/user_projects/domains//startWebLogic.sh: No such file or directory
touch: cannot touch ‘/u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log’: No such file or directory
tail: cannot open ‘/u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log’ for reading: No such file or directory
tail: no files remaining
weblogic

Most helpful comment

To all who are struggling as I did:

docker run -it -p 7001:7001 -p 9002:9002 -v $PWD:/u01/oracle/properties container-registry.oracle.com/middleware/weblogic:12.2.1.3 /bin/bash

[oracle@3c2d1c0573f5 oracle]$ export DOMAIN_NAME=base_domain
[oracle@3c2d1c0573f5 oracle]$ ./createAndStartEmptyDomain.sh

For me this solved the problem. You just need to wait for the container now to init.

All 43 comments

Could you share the command you are using to start the container?

The following command does end up starting the container for a few seconds, and then it exits:

docker run -d -p 7001:7001 -p 9002:9002 -v $PWD:/u01/oracle/properties store/oracle/weblogic:12.2.1.4

Also tried the following to start a stopped container:

docker start 1d0d4b325d94 -a                                                
Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"/u01/oracle/createAndStartEmptyDomain.sh\": stat /u01/oracle/createAndStartEmptyDomain.sh: no such file or directory": unknown

I suspect you do not have permissions to see the properties file. The owner of the directories is oracle:oracle you can not be root also the permission s of the host directory where the properties file is should be 777. Try
docker run -it -v $PWD:/u01/oracle/properties store/oracle/weblogic:12.2.1.4 /bin/bash
then cd /u01/oracle/properties and see if you can cat the properties file.

Yup, that did it. Thank you

Actually, sorry, the container stays running now and I can cat the properties file, but when I run createAndStartEmptyDomain.sh I still get the following:

Exiting WebLogic Scripting Tool.

createAndStartEmptyDomain.sh: line 66: /u01/oracle/user_projects/domains//bin/setDomainEnv.sh: No such file or directory
createAndStartEmptyDomain.sh: line 70: /u01/oracle/user_projects/domains//startWebLogic.sh: No such file or directory
touch: cannot touch ‘/u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log’: No such file or directory
tail: cannot open ‘/u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log’ for reading: No such file or directory

Same error here with oficial dockerhub image of oracle weblogic. Can't start the container : (

domain_name : [base_domain]
admin_listen_port : [7001]
domain_path : [/u01/oracle/user_projects/domains/base_domain]
production_mode : [prod]
admin name : [AdminServer]
administration_port_enabled : [true]
administration_port : [9002]

Exiting WebLogic Scripting Tool.
/u01/oracle/createAndStartEmptyDomain.sh: line 66: /u01/oracle/user_projects/domains//bin/setDomainEnv.sh: No such file or directory
/u01/oracle/createAndStartEmptyDomain.sh: line 70: /u01/oracle/user_projects/domains//startWebLogic.sh: No such file or directory
touch: cannot touch ‘/u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log’: No such file or directory
tail: cannot open ‘/u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log’ for reading: No such file or director
tail: no files remaining

@astrapotro
I was able to start the container with the command from @mriccell

Despite the errors we both get when running createAndStartEmptyDomain.sh it does actually create the path /u01/oracle/user_projects/domains/base_domain and you can go to that path to runstartWebLogic.sh which should successfully start the server.

@astrapotro
I was able to start the container with the command from @mriccell

Despite the errors we both get when running createAndStartEmptyDomain.sh it does actually create the path /u01/oracle/user_projects/domains/base_domain and you can go to that path to runstartWebLogic.sh which should successfully start the server.

thanks @Aydin- . I did it like you posted, startWeblogic.sh worked , but i can't reach admin console in 0.0.0.0:7002/console --> it shows �P
Any ideas?

What port are you mapping to in the -p directive?
Did you run docker inspect --format '{{.NetworkSettings.IPAddress}}' to find the ip address to invoke?

docker inspect --format '{{.NetworkSettings.IPAddress}

docker run -it --name weblogic --restart always -p 7001:7001 -p 7002:7002 -p 9002:9002 -v $PWD:/u01/oracle/properties store/oracle/weblogic:12.2.1.4 /bin/bash


 "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "3d076ca30ef3f6d9dc94dd0cffd7eaa3bc9cfd582b00b5a043ba63bdf02946d1",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "7001/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "7001"
                    }
                ],
                "7002/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "7002"
                    }
                ],
                "9002/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "9002"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/3d076ca30ef3",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "2c080762f8f1f79072b52d314b9a3b303b7e46413ab44b9d8a5d7ba777d3bef5",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.3",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "4f7326e0ba9416a135159d97f3c733b5e4c995cb19871748395d29a815215454",
                    "EndpointID": "2c080762f8f1f79072b52d314b9a3b303b7e46413ab44b9d8a5d7ba777d3bef5",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.3",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "DriverOpts": null
                }
            }

Sorry for being so newbie: Simplilly changed http://0.0.0.0:7002/console to https://0.0.0.0:7002/console did the trick.
Thanks for helping

To all who are struggling as I did:

docker run -it -p 7001:7001 -p 9002:9002 -v $PWD:/u01/oracle/properties container-registry.oracle.com/middleware/weblogic:12.2.1.3 /bin/bash

[oracle@3c2d1c0573f5 oracle]$ export DOMAIN_NAME=base_domain
[oracle@3c2d1c0573f5 oracle]$ ./createAndStartEmptyDomain.sh

For me this solved the problem. You just need to wait for the container now to init.

> [oracle@3c2d1c0573f5 oracle]$ export DOMAIN_NAME=base_domain

This is explicitly set in the Dockerfile: https://github.com/oracle/docker-images/blob/master/OracleWebLogic/dockerfiles/12.2.1.3/Dockerfile.generic#L78

You may want to pull the latest version of container-registry.oracle.com/middleware/weblogic:12.2.1.3 to ensure you're using the most up-to-date version of that image. Docker doesn't do this automatically for you.

You may want to pull the latest version of container-registry.oracle.com/middleware/weblogic:12.2.1.3 to ensure you're using the most up-to-date version of that image. Docker doesn't do this automatically for you.

Pulled the image 5 hours ago. I came here because I got the error..

I still have it in my terminal:

Unable to find image 'container-registry.oracle.com/middleware/weblogic:12.2.1.3' locally
12.2.1.3: Pulling from middleware/weblogic
822ace0353cb: Already exists 
5530c635d7c1: Pull complete 
7a6cdb2f1336: Pull complete 
474428c2ed86: Pull complete 
873179d0aeb5: Pull complete 
202b91aacf60: Pull complete 
Digest: sha256:47dfd4fdf6b56210a6c49021b57dc2a6f2b0d3b3cfcd253af7a75ff6e7421498
Status: Downloaded newer image for container-registry.oracle.com/middleware/weblogic:12.2.1.3

Pulled the image 5 hours ago. I came here because I got the error..

Interesting. What's the output of env before you set the DOMAIN_NAME in the container?

I suspect you do not have permissions to see the properties file. The owner of the directories is oracle:oracle you can not be root also the permission s of the host directory where the properties file is should be 777. Try
docker run -it -v $PWD:/u01/oracle/properties store/oracle/weblogic:12.2.1.4 /bin/bash
then cd /u01/oracle/properties and see if you can cat the properties file.

permission denied while executing cat properties/
cat: properties/: Permission denied

image

Can you let me know if this can be solved? can't change the permission of file manually.

1001 is user 'oracle' and the properties is not a file but a directory

what is $PWD and what are the permissions in your host directory

what is $PWD and what are the permissions in your host directory
$PWD is /home/oracle
image
yes properties is directory, can't go inside properties, getting permission denied.

image

I am experiencing the same issue. When setting the variable as hardcoreit suggested (ie export DOMAIN_NAME=base_domain) , I was able to get the weblogic server to start.

Does it work if you use -e DOMAIN_NAME=base_domain on the docker run command line as well?

Can you also provide the output from docker info on your testing machines? I'm wondering if the behavior of ENV has changed on some platforms.

Yes, the "-e"option worked.

-bash-4.2$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 3
Server Version: 18.09.8-ol
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: c4446665cb9c30056f4998ed953e6d4ff22c7c39
runc version: 4bb1fe4ace1a32d3676bb98f5d3b6a4e32bf6c58
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.1.12-124.32.3.el7uek.x86_64
Operating System: Oracle Linux Server 7.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 6.854GiB
Name: den01dmo
ID: LVWL:RR6I:IC3H:7OK3:AHIA:SES4:3B2F:6WDW:VHN6:GDRH:OM6S:WPFG
Docker Root Dir: /scratch/kstrong/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: XXXXXX
HTTPS Proxy:XXXXX
No Proxy: XXXXXXXXX
Username: kirkstrongoracle
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

Registries: docker.io (secure)
-bash-4.2$ 

(Edited for formatting)

I'm struggling to reproduce this. Can you please create a Dockerfile with the following content:

FROM oracle/serverjre: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

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}"

And build it like so:

$ docker build -t env-test .

And then run it:

$ docker run --rm -it env-test env

I get the right results, i.e. I see all the default values as set in the Dockerfile:

PATH=/usr/java/jdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/java/jdk-8/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
HOSTNAME=d28063ae8f99
TERM=xterm
LANG=en_US.UTF-8
JAVA_VERSION=1.8.0_241
JAVA_HOME=/usr/java/jdk-8
ORACLE_HOME=/u01/oracle
USER_MEM_ARGS=-Djava.security.egd=file:/dev/./urandom
SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh
DOMAIN_NAME=base_domain
ADMIN_LISTEN_PORT=7001
ADMIN_NAME=AdminServer
ADMINISTRATION_PORT_ENABLED=true
ADMINISTRATION_PORT=9002
HOME=/root

And there's no default between the default output and if I manually specify -e DOMAIN_NAME=base_domain so I'm wondering what else is in play here.

Can you add set -x to the top of the createAndStartEmptyDomain.sh stript (after the shebang line) so we can see where things are failing as the container starts?

$ sh -x ./createAndStartEmptyDomain.sh
+ trap _term SIGTERM
+ trap _kill SIGKILL
+ export DOMAIN_HOME=/u01/oracle/user_projects/domains/
+ DOMAIN_HOME=/u01/oracle/user_projects/domains/
+ echo 'Domain Home is: ' /u01/oracle/user_projects/domains/
Domain Home is:  /u01/oracle/user_projects/domains/
+ ADD_DOMAIN=1
+ '[' '!' -f /u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log ']'
+ ADD_DOMAIN=0
+ mkdir -p /u01/oracle/properties
+ '[' 0 -eq 0 ']'
+ PROPERTIES_FILE=/u01/oracle/properties/domain.properties
+ '[' '!' -e /u01/oracle/properties/domain.properties ']'
++ cut -d = -f2
++ grep username
++ awk '{print $1}' /u01/oracle/properties/domain.properties
+ USER=weblogic
+ '[' -z weblogic ']'
++ cut -d = -f2
++ grep password
++ awk '{print $1}' /u01/oracle/properties/domain.properties
+ PASS=welcome1
+ '[' -z welcome1 ']'
+ wlst.sh -skipWLSModuleScanning -loadProperties /u01/oracle/properties/domain.properties /u01/oracle/create-wls-domain.py

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

domain_name                 : [base_domain]
admin_listen_port           : [7001]
domain_path                 : [/u01/oracle/user_projects/domains/base_domain]
production_mode             : [prod]
admin name                  : [AdminServer]
administration_port_enabled : [true]
administration_port         : [9002]


Exiting WebLogic Scripting Tool.

+ mkdir -p /u01/oracle/user_projects/domains//servers/AdminServer/security/
+ echo username=weblogic
+ echo password=welcome1
+ /u01/oracle/user_projects/domains//bin/setDomainEnv.sh
./createAndStartEmptyDomain.sh: line 66: /u01/oracle/user_projects/domains//bin/setDomainEnv.sh: No such file or directory
+ /u01/oracle/user_projects/domains//startWebLogic.sh
./createAndStartEmptyDomain.sh: line 70: /u01/oracle/user_projects/domains//startWebLogic.sh: No such file or directory
+ touch /u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log
touch: cannot touch ‘/u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log’: No such file or directory
+ childPID=140
+ tail -f /u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log
+ wait 140
tail: cannot open ‘/u01/oracle/user_projects/domains//servers/AdminServer/logs/AdminServer.log’ for reading: No such file or directory
tail: no files remaining
$ 

(Edited for formatting)

-bash-4.2$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (XXXXXXXX): 
Password: 
WARNING! Your password will be stored unencrypted in /home/XXXXXX/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
-bash-4.2$ docker pull store/oracle/serverjre:8
Trying to pull repository docker.io/store/oracle/serverjre ... 
pull access denied for store/oracle/serverjre, repository does not exist or may require 'docker login'
pull access denied for store/oracle/serverjre, repository does not exist or may require 'docker login'
-bash-4.2$ docker build -t env-test .
Sending build context to Docker daemon   2.56kB
Step 1/3 : FROM oracle/serverjre:8
Trying to pull repository docker.io/oracle/serverjre ... 
pull access denied for oracle/serverjre, repository does not exist or may require 'docker login'
-bash-4.2$ 

You need to build oracle/serverjre:8 from this repo first. That would be needed to build the WebLogic image anyway.

-bash-4.2$ docker build -t env-test .
Sending build context to Docker daemon   2.56kB
Step 1/3 : FROM store/oracle/serverjre:8
Trying to pull repository docker.io/store/oracle/serverjre ... 
8: Pulling from docker.io/store/oracle/serverjre
822ace0353cb: Pull complete 
f124784ae4d9: Pull complete 
f4cc77704d9f: Pull complete 
Digest: sha256:309c408ef0482e119ee838923a2caf016d12732c47a3bc291e81d020bbf5846b
Status: Downloaded newer image for store/oracle/serverjre:8
 ---> ef9c1a0152ab
Step 2/3 : 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 991a3eb48041
Removing intermediate container 991a3eb48041
 ---> 265d2ec5d1df
Step 3/3 : 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 0e18f829b4bd
Removing intermediate container 0e18f829b4bd
 ---> a026211b01ba
Successfully built a026211b01ba
Successfully tagged env-test:latest
-bash-4.2$ docker run --rm -it env-test env
PATH=/usr/java/jdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/java/jdk-8/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
HOSTNAME=a0e1dbe69440
TERM=xterm
LANG=en_US.UTF-8
JAVA_VERSION=1.8.0_241
JAVA_HOME=/usr/java/jdk-8
ORACLE_HOME=/u01/oracle
USER_MEM_ARGS=-Djava.security.egd=file:/dev/./urandom
SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh
DOMAIN_NAME=base_domain
ADMIN_LISTEN_PORT=7001
ADMIN_NAME=AdminServer
ADMINISTRATION_PORT_ENABLED=true
ADMINISTRATION_PORT=9002
HOME=/root
-bash-4.2$ 

If you put triple backticks, i.e. ``` on a line before and after your paste, it'll format it monospace. :)

So, let's go up a notch. Update the Dockerfile to this:

FROM oracle/serverjre: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

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}"

RUN mkdir -p /u01 && \
    chmod a+xr /u01 && \
    useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \
    chown oracle:oracle /u01

COPY container-scripts/testEnv.sh /u01/oracle

RUN chmod +xr /u01/oracle/testEnv.sh && \
    chown oracle:oracle /u01/oracle/testEnv.sh

USER oracle

CMD ["/u01/oracle/testEnv.sh"]

And create container-scripts/testEnv.sh with the following content, please:

#!/bin/bash
set -x

#Define DOMAIN_HOME
export DOMAIN_HOME=/u01/oracle/user_projects/domains/$DOMAIN_NAME
echo "Domain Home is: " $DOMAIN_HOME

Rebuild and run and let me know the results? On my test system, I get the right DOMAIN_HOME, i.e. it's Domain Home is: /u01/oracle/user_projects/domains/base_domain but in your original test, the createAndStartEmptyDomain.sh script didn't show the right value.

-bash-4.2$ docker build -t env-test .
Sending build context to Docker daemon  4.096kB
Step 1/8 : FROM store/oracle/serverjre:8
 ---> ef9c1a0152ab
Step 2/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
 ---> Running in b2c6849f2cec
Removing intermediate container b2c6849f2cec
 ---> ae187afd7102
Step 3/8 : 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 1d347c5812b3
Removing intermediate container 1d347c5812b3
 ---> 5db519004dcc
Step 4/8 : RUN mkdir -p /u01 &&     chmod a+xr /u01 &&     useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle &&     chown oracle:oracle /u01
 ---> Running in 701c3116401b
Removing intermediate container 701c3116401b
 ---> ef993c101053
Step 5/8 : COPY container-scripts/testEnv.sh /u01/oracle
 ---> 5e1568c8f0eb
Step 6/8 : RUN chmod +xr /u01/oracle/testEnv.sh &&     chown oracle:oracle /u01/oracle/testEnv.sh
 ---> Running in c7e99409c9cc
Removing intermediate container c7e99409c9cc
 ---> a61638120637
Step 7/8 : USER oracle
 ---> Running in 376fc0807ed1
Removing intermediate container 376fc0807ed1
 ---> b52e8b65af55
Step 8/8 : CMD ["/u01/oracle/testEnv.sh"]
 ---> Running in d1c8ee808734
Removing intermediate container d1c8ee808734
 ---> 6fa851e36743
Successfully built 6fa851e36743
Successfully tagged env-test:latest
-bash-4.2$ docker run --rm -it env-test env
PATH=/usr/java/jdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/java/jdk-8/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
HOSTNAME=358031b6ab92
TERM=xterm
LANG=en_US.UTF-8
JAVA_VERSION=1.8.0_241
JAVA_HOME=/usr/java/jdk-8
ORACLE_HOME=/u01/oracle
USER_MEM_ARGS=-Djava.security.egd=file:/dev/./urandom
SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh
DOMAIN_NAME=base_domain
ADMIN_LISTEN_PORT=7001
ADMIN_NAME=AdminServer
ADMINISTRATION_PORT_ENABLED=true
ADMINISTRATION_PORT=9002
HOME=/u01/oracle
-bash-4.2$ docker run -p 7001:7001 -p 9002:9002 -v $PWD:/u01/oracle/properties env-test
Domain Home is:  /u01/oracle/user_projects/domains/base_domain
+ export DOMAIN_HOME=/u01/oracle/user_projects/domains/base_domain
+ DOMAIN_HOME=/u01/oracle/user_projects/domains/base_domain
+ echo 'Domain Home is: ' /u01/oracle/user_projects/domains/base_domain
-bash-4.2$ 

Right. That works. Which means I don't understand why the WebLogic one isn't working for you. I'm doing exactly the same things in this set of stripped Dockerfiles as @mriccell is doing in the larger Dockerfiles. I'll keep prodding to see if I can find what breaks the DOMAIN_NAME value because it's happening before the script is called by CMD.

I have reproduced the issue internally. I'll give @mriccell access to my test system so she can go from there.

Hi, I have had exactly the same issue with the image failing to start as described at the beginning of this issue (same error messages in the log) with 12.2.1.4-slim version I downloaded recently. After reading the posts I tried running docker run with with the -e parameter:
docker run -d -e DOMAIN_NAME=base_domain -v $PWD:/u01/oracle/properties container-registry.oracle.com/middleware/weblogic:12.2.1.4-slim

Now the image starts but I can't connect to https://localhost:9002/console/ on the same machine.
There are no errors in the log file this time. Weblogic seems to be started:
Any idea please?

Hi, I have had exactly the same issue with the image failing to start as described at the beginning of this issue (same error messages in the log) with 12.2.1.4-slim version I downloaded recently

This is a known issue with the images on Oracle Container Registry (and is being addressed). If you build the image using the Dockerfiles in this repo, you should not have this problem.

docker run -d -e DOMAIN_NAME=base_domain -v $PWD:/u01/oracle/properties container-registry.oracle.com/middleware/weblogic:12.2.1.4-slim

You need to add -p 9002:9002 to this line to map the port into your container.

Of course thanks for pointing this out. After running with -p I can connect to https://localhost:9002/console/ but now I get:
Error 404--Not Found

Sounds like the domain still isn't created correctly. Check your logs, because I suspect the OCR images need _all_ the environment variables provided. You may have better luck by building the image yourself using the Dockerfiles.

@mkratky the WebLogic binaries in the slim image do not contain the WebLogic console bits. Please look at the README
2- The WebLogic slim image is supported for development and production deployment of WebLogic configurations using Docker. In order to reduce image size, it contains a subset of the binaries included in the WebLogic generic image. The WebLogic console, WebLogic examples, WebLogic clients, Maven plug-ins and Java DB have been removed - all binaries that remain included are the same as those in the WebLogic generic image.

If you want to start the console you must build the generic or developer images.

With the slim image you can run REST see a sample on how to check server status https://www.oracle.com/technical-resources/articles/middleware/soa-oliveira-wls-rest-javafx.html

New images posted to OCR yesterday should correct these issues.

for docker image store/oracle/weblogic:12.2.1.4-dev-200117
follow this link " https://hub.docker.com/_/oracle-weblogic-server-12c "

$ docker run -d --name weblogic-12.2.1.4 -p 7001:7001 -p 9002:9002 -v /u01/oracle/properties:/u01/oracle/properties store/oracle/weblogic:12.2.1.4-dev-200117

docker cp weblogic-12.2.1.4:/u01/oracle/createAndStartEmptyDomain.sh .

vim createAndStartEmptyDomain.sh

modify this line

Define DOMAIN_HOME

export DOMAIN_HOME=/u01/oracle/user_projects/domains/$DOMAIN_NAME

to

export DOMAIN_HOME=/u01/oracle/user_projects/domains/base_domain

and save

change permission

chmod 777 createAndStartEmptyDomain.sh

docker cp createAndStartEmptyDomain.sh weblogic-12.2.1.4:/u01/oracle/

and restart

docker restart weblogic-12.2.1.4

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nfornag picture nfornag  Â·  3Comments

rajeshpasupathy picture rajeshpasupathy  Â·  5Comments

jamataran picture jamataran  Â·  3Comments

Ijlalh90 picture Ijlalh90  Â·  4Comments

skoky picture skoky  Â·  4Comments