@jrc's answer is correct. I've tested it with Raintank's Graphite stack image, raintank/graphite-stack
, on Elastic Beanstalk multi-container Docker environment (which on contrary to single-container Docker environment which uses nginx as a reverse proxy to the container's port and doesn't support multi-ports and UDP, is a frontend to ECS). Corresponding Dockerrun.aws.json
looks like this:
{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [
{
"name": "stack",
"image": "raintank/graphite-stack",
"essential": true,
"memory": 850,
"portMappings": [
{
"containerPort": 3000,
"hostPort": 80
},
{
"containerPort": 8125,
"hostPort": 8125,
"protocol": "udp"
}
]
}
]
}
Then logging in to the corresponding EC2 instance and typing sudo docker ps
gives:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
12a5711dab47 raintank/graphite-stack "/usr/bin/supervisord" 2 minutes ago Up 2 minutes 443/tcp, 2003/tcp, 8125/tcp, 0.0.0.0:8125->8125/udp, 0.0.0.0:80->3000/tcp ecs-awseb-test-abc-1-stack-abc
930a9b814df4 amazon/amazon-ecs-agent:latest "/agent" 3 minutes ago Up 3 minutes ecs-agent
Issuing statsd UDP packet manually, echo "test.statsd:1|c" | nc -w 1 -u test.aws-region.elasticbeanstalk.com 8125
, I see it appearing in the Graphite.