<p>The Dockerfile I used to create this Docker Image. It works well in my local system.</p>

<pre><code>FROM payara/server-full

COPY ./target/jakartaee8-starter.war $DEPLOY_DIR
</code></pre>

<p>It seems OpenShift runs docker by a none-root user. But <code>payara/server-full</code> is maintained by Payara, so it is not controlled by me. How to fix this in Openshift?</p>

<pre class="lang-sh prettyprint-override"><code>[Entrypoint] running /opt/payara/scripts/init_1_generate_deploy_commands.sh
touch: cannot touch '/opt/payara/config/post-boot-commands.asadmin': Permission denied
touch: cannot touch '/opt/payara/config/pre-boot-commands.asadmin': Permission denied
grep: /opt/payara/config/post-boot-commands.asadmin: No such file or directory
Adding deployment target /opt/payara/deployments/jakartaee8-starter.war to post boot commands
/opt/payara/scripts/init_1_generate_deploy_commands.sh: line 48: /opt/payara/config/post-boot-commands.asadmin: Permission denied

[Entrypoint] ignoring /opt/payara/scripts/init.d/*

touch: cannot touch '/opt/payara/config/post-boot-commands.asadmin': Permission denied
touch: cannot touch '/opt/payara/config/pre-boot-commands.asadmin': Permission denied
preboot commands file does not exist: /opt/payara/config/pre-boot-commands.asadmin
Usage: asadmin [asadmin-utility-options] start-domain
    [-v|--verbose[=&lt;verbose(default:false)&gt;]]
    [--upgrade[=&lt;upgrade(default:false)&gt;]]
    [-w|--watchdog[=&lt;watchdog(default:false)&gt;]]
    [-d|--debug[=&lt;debug(default:false)&gt;]]
    [-n|--dry-run[=&lt;dry-run(default:false)&gt;]]
    [--drop-interrupted-commands[=&lt;drop-interrupted-commands(default:false)&gt;]]
    [--prebootcommandfile &lt;prebootcommandfile&gt;]
    [--postbootcommandfile &lt;postbootcommandfile&gt;] [--domaindir &lt;domaindir&gt;]
    [-?|--help[=&lt;help(default:false)&gt;]] [domain_name]
ERROR: Command start-domain failed.
</code></pre>

<p>You should update the security context permissions of the user and namespace.</p>

<p>e.g.</p>

<pre><code>oc adm policy add-scc-to-user privileged -z default -n &lt;YOUR_NAMESPACE&gt;
</code></pre>
