- Newest
- Most votes
- Most comments
You cannot directly modify the default Docker bridge network's IP range used by containers. However, you can create your own custom bridge network with a specific subnet configuration and attach it.
Use the docker network create command to create a custom bridge network with the desired subnet configuration. eg
docker network create --subnet=<your-subnet> my-custom-bridge-network
In your definitions, specify the networkMode parameter as bridge and dockerNetworkConfiguration to reference your custom bridge network. eg
json
Copy code
{
"containerDefinitions": [
{
...
"networkMode": "bridge",
"dockerNetworkConfiguration": {
"subnet": "<your-subnet>",
"aliases": [],
"ipv4Address": "<your-ipv4-address>"
}
}
]
}
If you're using ECS services, update the service to use the new task definition with the custom bridge network.If you're using standalone tasks, update the task definition to use the custom bridge network.By creating a custom bridge network with your desired subnet configuration and updating your ECS task definitions to use this network, you can avoid clashes with internal IPs and have better control over the network configuration for your containers. Remember to test your changes to ensure compatibility and proper functionality with your applications.
Hope it clarifies and if does I would appreciate answer to be accepted so that community can benefit for clarity, thanks ;)
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 months ago