2 Answers
- Newest
- Most votes
- Most comments
0
Example Use Case:
If your component needs to run a web server that should be accessible on the host's network interface, using NetworkMode: host allows it to bind to the host's ports directly without needing to map ports explicitly.
By configuring your Greengrass component in this manner, you can achieve network behavior similar to Docker's --network=host while maintaining control over file system isolation.
answered 3 months ago
0
Yes, you can achieve the equivalent of Docker's --network=host in AWS IoT Greengrass v2, but it requires configuring your Greengrass component to use the host network mode. This way, your Greengrass component will have the same network namespace as the host, allowing it to bind to the host ports directly.
answered 3 months ago
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Thank you for your help. Let me clarify, my Greengrass v2 does runs as a service on the host machine not inside a container. It's just the component that runs inside a container. NetworkMode: host does sound very promising. I've checked again the documentation for LambdaLinuxProcessParams (https://docs.aws.amazon.com/greengrass/v2/APIReference/API_LambdaLinuxProcessParams.html) but can't find it. Can you point me to the documentation please?
Hey George. Don't use Lambda's but run Docker locally on the same host as Greengrass. Your component in that case would instantiate the container (with command to bind to host's network). You can do this via direct
docker run
or use a compose file. Note that you then need to address file system isolation at the container level, but that's standard use case for docker volumes.