Deploy a configurable docker memcached alpine container using just dockerrun.aws.json


« Back to overview

Deploy a memcached alpine image using multicontainer dockerrun.aws.json

This dockerrun.aws.json deploys a memcached container, with memory sizes set by environment variables.


dockerrun.aws.json:
{
  "AWSEBDockerrunVersion": 2,
  "containerDefinitions": [
    {
      "name": "memcached",
      "image": "memcached:1.5.19-alpine",
      "memoryReservation": 32,
      "essential": true,
      "environment" : [
        {"name": "MEMCACHED_MEMORY", "value": "16"},
        {"name": "MEMCACHED_MAX_CONNECTIONS", "value": "256"},
        {"name": "MEMCACHED_MAX_ITEMSIZE", "value": "1M"}
      ],
      "command": [ "/bin/sh", "-c", "memcached -m ${MEMCACHED_MEMORY:=16} -c ${MEMCACHED_MAX_CONNECTIONS:=512} -I ${MEMCACHED_MAX_ITEMSIZE:=1M}"]
    }
  ]
Off-topic: in your container, check the configuration of memcached:
echo "stats" | nc localhost 11211