Reputation: 937
We are building our application on CodeBuild and have unit tests that spawn a elastic daemon to run some tests. However, the unit tests fails with the exception that elasticsearch can't run as root but CodeBuild always run commands as root.
Are there any recommended workarounds? Is there any command in elastic 6+ to run as root?
Thanks
Error: Caused by: java.lang.RuntimeException: can not run elasticsearch as root
Upvotes: 1
Views: 402
Reputation: 2545
If your script needs to run as a specific user, you may use the "run-as" option as described in https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax
Upvotes: 1