I'm using testcontainers.org using docker.elastic.co/elasticsearch/elasticsearch-oss:7.3.2
and I want to use it to test the plugin I'm updating, but I can't find a way to install it inside test environment.
I can try to copy file inside and install it
ElasticsearchContainer container = new ElasticsearchContainer("docker.elastic.co/elasticsearch/elasticsearch-oss:$ELASTIC_VERSION")
String pluginPath = "/usr/share/elasticsearch/$PLUGIN_FILE_NAME"
container.start()
container.copyFileToContainer(MountableFile.forHostPath(new File(PLUGIN_PLUGIN_PATH).toPath()), pluginPath)
ExecResult result = container.execInContainer("bin/elasticsearch-plugin", "install", "file://$pluginPath")
but then container is already started and elastic search is already running so plugin will not be loaded so I would need to kill it and replicate how it is created, sounds like a lot of hacking around. Is there some better way to do this?