Docker ADD and COPY leave files owned by root by default

By trial and error I worked this out while building a container running Weblogic Portal 10.3.6 (see my Dockerfiles in the 10.3.6updates branch of my fork of oracle/docker: https://github.com/kevinhooke/weblogic-docker/tree/10.3.6updates).

Even if you do a ‘USER oracle’ followed by a COPY or ADD, the files transferred into the image are still owned by root. This was causing me issues as the WLST script could not read the files owned by root (as you’d expect).

This issue and the justification is described in issue 6119. It doesn’t seem that this will be fixed, it seems like it’s ‘working as designed’.

Running Weblogic 10.3 config utils in console mode, and gui mode in a Docker container

Most of Weblogic’s config utilities can run in a console/text mode if you need to run them from a terminal session in text mode, by passing the option: -mode=console

E.g. the apps here: /[middlewarehome]/wlserver_10.3/common/bin, like config.sh will run in console mode.

config_builder.sh however does not, and only runs in gui mode. This is an issue if you’re running Weblogic in a Docker container. All is not lost however, as you can forward X out of a Docker container, but it takes a few steps to get running.

Follow the steps in this logged issue to install and run socat, and then pass ‘-e DISPLAY=192.168.99.1:0’ where the IP address is the address of the vbox interface.  On my Mac this looked like:

socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

then:

docker run -it -e DISPLAY=192.168.99.1:0 imageid bash

My image included xterm and dependencies installed via the Dockerfile with:

RUN yum install -y xterm

When attempting to run config.sh in gui mode however, it gave me this error:

Unable to instantiate GUI, defaulting to console mode.

This is fine for config.sh at it runs in console mode, but since config_builder.sh does not, it must run in gui mode with forwarded XWindows.

This post on ServerFault held the key – you need to also install libXtst:

yum install libXtst

Now all the utils will run in GUI mode forwarding X to your host. On Mac OS X this assumes also that you have XQuartz installed too.

Weblogic Portal 10.3.6 generic installer on Mac OS X – Insufficient Disk Space error

Trying to use the portal103_generic.jar installer on Mac OS X 10.11.1 gives this error even though you have plenty of free space:

A quick Google turns up this question and answer. Quick fix, run passing this option: -Dos.name=unix, so:

java -Dos.name=unix -jar portal103_generic.jar

Although others reported this avoided the issue, I then got this issue instead:

Exception in thread "chmodFile" java.lang.Error: Unix is not a supported OS platform.
 at java.lang.UNIXProcess$Platform.get(UNIXProcess.java:164)

Following additional suggestion here, using -Dspace.detection=false instead avoided the issue.

Weblogic JSP precompile on deploy

Add this to weblogic.xml:

    <wls:jsp-descriptor>
      <wls:precompile>true</wls:precompile>
        <wls:precompile-continue>true</wls:precompile-continue>
    </wls:jsp-descriptor>