I'm trying to use an elasticsearch docker image in a test, using the testcontainers library to manage spinning it up. When using the "5.6.4" image from "docker.elastic.co/elasticsearch/elasticsearch", it correctly reponds to env config being passed in for cluster name, http and transport ports, and xpack settings. However, when I use the same image from "registry.hub.docker.com/library/elasticsearch" these configuration options seem to have no effect.
My reasons for using "registry.hub.docker.com/library/elasticsearch" is that it also has an image for 1.7.1 available, and I'm currently dealing with an environment that must support both versions concurrently (in different clusters) while applications are migrated.
Are the images from these two sources not the same? Or am I simply doing something wrong? I am open to trying other versions to track down this issue, and will shortly attempt setting the environmental variables manually through docker command line to see if that works.
It's not super intuitive, sorry, but these two images are actually completely different. Image versions between 1.x and 5.x, when pulled from Docker Hub, are images that were built by the Docker library team. They are based on this Dockerfile.
In parallel, we (Elastic) began building our own official images for our products. These are available for versions 5.x and 6.x. They are based on this Dockerfile template. As you can see, they are very different. Among other things, our images provide a mechanism for environment-based configuration.
The good news is that we recently unified with Docker Hub, and from version 6.4 on, the images on the Docker Hub are essentially copies of our images. However, the version 5.x images on the Hub will always remain the legacy images with different configuration semantics and no support for environment variables.
I've managed to work round this by manually creating a config file replacement and using a function of the testcontainers library to put it in the right place before the image is started. I'll make a note that the images are different for when we finally migrate to 6.x!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.