Setting Docker container hostname on Elastic Beanstalk
amazon-elastic-beanstalk, amazon-web-services, docker
Solution
As far as I know this is not supported out of the box.
A possible hack here is to exploit EB's poor parsing of environment variables. You can setup an environment variable such as: `PARAM1=dummy -h MYHOSTNAME` EB doesn't quote the parameters, so your `-h` part will be embedded into the docker run command. I didn't try it myself.
Another option would be to create an `ebextension` file to patch the `/opt/elasticbeanstalk/hooks/appdeploy/pre/04run.sh` script, injecting the `-h MYHOST` line into it.
Problem
I would like to set the hostname for a Docker container deployed on AWS Elastic Beanstalk manually. You can set the hostname when spinning up a container with `docker run -h HOSTNAME`, but I can't figure out how (or even if) to pass custom arguments to the `docker run` command. The Dockerrun.aws.json file seems a likely candidate, but there are no documented keys that do what I want. Does anyone know if this is possible?