-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I run some workloads outside ec2 but I need each container have its own set of permissions. On the doc is not so clear how to get that configuration. It is just use a different instance of iam-docker with its own key pair and port.
This config let you keep the minimum permissions principle also outside ec2.
Would be nice to have a example showing how to run it in different ports. There is no mention about that possibility in the docs
$ PORT="40100"`
$ iptables -t nat \
-I PREROUTING \
-p tcp \
-d 169.254.169.254 \
--dport 80 \
-j REDIRECT \
--to-ports "$PORT" \
-i "$INTERFACE"
$ docker run --name iam_proxy -d \
-e AWS_ACCESS_KEY_ID=key4role1 \
-e AWS_SECRET_ACCESS_KEY=secret4role1 \
-e AWS_DEFAULT_REGION=eu-west-1 \
--volume /var/run/docker.sock:/var/run/docker.sock \
--net=host \
--entrypoint "/iam-docker" \
swipely/iam-docker:latest --listen-addr ":${PORT}"
Of course each application requires its own iptables rule.