I am launching one Docker container on Elastic Beanstalk using the Docking Station Single Container Configuration and trying to send the stdout application to the CloudWatch application using the awslogs log driver .
EB is looking for the Dockerrun.aws.json file to configure the container, but as far as I can see, it is not possible to use awslogs as a container registration driver (or add any other flags in docker run
).
I tried to hack the docker run
using the provided here by adding the .ebextensions/01-commands.config
file with content:
commands: add_awslogs: command: 'sudo sed -i "s/docker run -d/docker run --log-driver=awslogs --log-opt awslogs-region=eu-west-2 --log-opt awslogs-group=dockerContainerLogs -d/" /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh'
This works in the sense that it changes the mileage of the script, and the logs are displayed in CloudWatch.
But the EB application is dying. The container rises, but does not respond to requests.
I found the following error in container logs:
Team"logs" is only supported for logging the "json-file" and "journald" drivers (received: awslogs)
I find answers to similar questions regarding ECS (not EB) by suggesting adding ECS_AVAILABLE_LOGGING_DRIVERS with awslogs. But I did not find this configuration setting in EB.
Any thoughts?
user1912899
source share