public ContainerDefinition withUser(String user) {
        setUser(user);
        return this;
    }
<p>
The user to use inside the container. This parameter maps to <code>User</code> in the <a
href="https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate">Create a container</a> section of the
<a href="https://docs.docker.com/engine/api/v1.35/">Docker Remote API</a> and the <code>--user</code> option to
<a href="https://docs.docker.com/engine/reference/run/#security-configuration">docker run</a>.
</p>
<important>
<p>
When running tasks using the <code>host</code> network mode, don't run containers using the root user (UID 0). We
recommend using a non-root user for better security.
</p>
</important>
<p>
You can specify the <code>user</code> using the following formats. If specifying a UID or GID, you must specify
it as a positive integer.
</p>
<ul>
<li>
<p>
<code>user</code>
</p>
</li>
<li>
<p>
<code>user:group</code>
</p>
</li>
<li>
<p>
<code>uid</code>
</p>
</li>
<li>
<p>
<code>uid:gid</code>
</p>
</li>
<li>
<p>
<code>user:gid</code>
</p>
</li>
<li>
<p>
<code>uid:group</code>
</p>
</li>
</ul>
<note>
<p>
This parameter is not supported for Windows containers.
</p>
</note>

@param user
       The user to use inside the container. This parameter maps to <code>User</code> in the <a
       href="https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate">Create a container</a> section
       of the <a href="https://docs.docker.com/engine/api/v1.35/">Docker Remote API</a> and the
       <code>--user</code> option to <a
       href="https://docs.docker.com/engine/reference/run/#security-configuration">docker run</a>.</p>
       <important>
       <p>
       When running tasks using the <code>host</code> network mode, don't run containers using the root user (UID
       0). We recommend using a non-root user for better security.
       </p>
       </important>
       <p>
       You can specify the <code>user</code> using the following formats. If specifying a UID or GID, you must
       specify it as a positive integer.
       </p>
       <ul>
       <li>
       <p>
       <code>user</code>
       </p>
       </li>
       <li>
       <p>
       <code>user:group</code>
       </p>
       </li>
       <li>
       <p>
       <code>uid</code>
       </p>
       </li>
       <li>
       <p>
       <code>uid:gid</code>
       </p>
       </li>
       <li>
       <p>
       <code>user:gid</code>
       </p>
       </li>
       <li>
       <p>
       <code>uid:group</code>
       </p>
       </li>
       </ul>
       <note>
       <p>
       This parameter is not supported for Windows containers.
       </p>
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/ContainerDefinition.java