I don’t think you can do that, since you are inside a container that does not have Docker on it by default. You’d be trying to do docker cp from inside a container to a sibling container, but you can’t do that in Docker (by default, anyway). You can only do this in the host, and you do not have access to that.
You have a few options:
Roll your own image that inherits from the specified one, and you can put your config in place with COPY
Pass the config to in a custom Elasticsearch command (assuming the binary supports switches for the things you want to change).
Drop the ES image and install ES manually in your build container