<p>I am trying to install docker inside an openshift pod like below.</p>
<pre><code>sh-4.2$ yum install docker
Loaded plugins: ovl, product-id, search-disabled-repos, subscription-manager
ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/.dbenv.lock'
You need to be root to perform this command.
sh-4.2$ id
uid=1001(1001) gid=0(root) groups=0(root)
sh-4.2$ 
</code></pre>
<p>Tried applying following
oc adm policy add-scc-to-user anyuid -z default</p>
<p>Could you please help.</p>

<p>You should specify &quot;0&quot; using &quot;runAsUser&quot; as follows. Because &quot;anyuid&quot; is using UID which is configured when an image builds if you do not specify the UID in your container. I think your image is build with 1001 UID initially as far as I can see the result.</p>
<pre><code>     containers:
     - name: YOURCONTAINERNAME
       :
       securityContext:
           runAsUser: 0
</code></pre>
