public ContainerDefinition withExtraHosts(HostEntry... extraHosts) {
        if (this.extraHosts == null) {
            setExtraHosts(new com.amazonaws.internal.SdkInternalList<HostEntry>(extraHosts.length));
        }
        for (HostEntry ele : extraHosts) {
            this.extraHosts.add(ele);
        }
        return this;
    }
public ContainerDefinition withExtraHosts ( HostEntry ... extraHosts ) { if ( this . extraHosts == null ) { setExtraHosts ( new com . amazonaws . internal . SdkInternalList < HostEntry > ( extraHosts . length ) ) ; } for ( HostEntry ele : extraHosts ) { this . extraHosts . add ( ele ) ; } return this ; }
<p>
A list of hostnames and IP address mappings to append to the <code>/etc/hosts</code> file on the container. This
parameter maps to <code>ExtraHosts</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>--add-host</code> option
to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>.
</p>
<note>
<p>
This parameter is not supported for Windows containers or tasks that use the <code>awsvpc</code> network mode.
</p>
</note>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setExtraHosts(java.util.Collection)} or {@link #withExtraHosts(java.util.Collection)} if you want to
override the existing values.
</p>

@param extraHosts
A list of hostnames and IP address mappings to append to the <code>/etc/hosts</code> file on the
container. This parameter maps to <code>ExtraHosts</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>--add-host</code> option to <a href="https://docs.docker.com/engine/reference/run/">docker
run</a>.</p> <note>
<p>
This parameter is not supported for Windows containers or tasks that use the <code>awsvpc</code> network
mode.
</p>
@return Returns a reference to this object so that method calls can be chained together.