If you are using a .json file for docker deploys, then you cannot use .ebextensions.
You can however create a zip that contains your .json and your .ebextension directory and everything should work. Use the zip as your deployment artifact instead of the raw json.