You can use the following methods to access the Internet from containers:
- Use the Network Address Translation (NAT) gateway bound to the Virtual Private Cloud (VPC) to which your container instance belongs.
- Directly bind the container instance to an elastic IP address (EIP).
Access the Internet by using NAT
For more information, see NAT.
Bind a container instance to an EIP
You can bind a container instance to an EIP by using the SDK or the console. In this example, the console is used.
You have a container group in the Running state.
Log in to the EIP console and purchase an EIP. For more information, see EIP User Guide.
Select the EIP you just purchased and click Bind Resource in the Operation column.
Select Container Instance as the binding mode, select the container instance to bind to the EIP, and then click Bind.