<p>How do I <code>docker run</code> private image from Container Registry in GCP using <code>--privileged</code>
Running this locally works fine:</p>
<pre><code>docker run -it --privileged --entrypoint /bin/bash ${GKE_APP}
</code></pre>
<p>I followed <a href="https://stackoverflow.com/questions/59001647/kubernetespodoperator-privileged-security-context-in-airflow">this</a> but the error still persisted.</p>
<p>This is my DAG:</p>
<pre><code>def process_backup_data(data_to_backup):

    secret_file = Secret('volume', '/etc/secrets', 'my-secret')

    task_env_vars = {'GOOGLE_APPLICATION_CREDENTIALS': &quot;/etc/secrets/my-sa.json}
    

    security_context = {
                        'privileged': True,
                        'allow_privilege_escalation': True,
                        'capabilities': {'add': ['SYS_ADMIN']}
                       }

    return KubernetesPodOperator(image=&quot;asia.gcr.io/my-image:latest&quot;,
                         env_vars=task_env_vars,
                         cmds=[&quot;sh&quot;, &quot;run-vpn-script.sh&quot;],
                         arguments=[data_to_backup],
                         labels={&quot;project&quot;: &quot;my-project&quot;},
                         name=&quot;my-project-backup-datasets&quot;,
                         task_id=f&quot;backup_{task_id}&quot;,
                         dag=dag,
                         secrets=[secret_file],
                         image_pull_policy='Always',
                         security_context=security_context # HERE
                         )

</code></pre>

user6308605
<p>Have you checked whether you are missing some sort of capability?</p>
<p>I see in the example you posted they also add this to the <code>security_context</code></p>
<pre class="lang-py prettyprint-override"><code>'capabilities': {'add': ['SYS_ADMIN']}
</code></pre>
