blacktop / docker-elasticsearch-alpine Goto Github PK
View Code? Open in Web Editor NEWAlpine Linux based Elasticsearch Docker Image
License: MIT License
Alpine Linux based Elasticsearch Docker Image
License: MIT License
Compared to the official images, the blacktop images for versions 5 and 6 are a lot smaller.
For 5.6.16 it's ~400MB smaller:
$ docker image ls | grep 5.6.16
blacktop/elasticsearch 5.6.16 121MB
docker.elastic.co/elasticsearch/elasticsearch 5.6.16 529MB
For 6.5.4 it's ~500MB smaller:
$ docker image ls | grep 6.5.4
blacktop/elasticsearch 6.5.4 121MB
docker.elastic.co/elasticsearch/elasticsearch-oss 6.5.4 645MB
But for 7.2.0 the blacktop image is ~500MB larger than the other versions, and is not a lot smaller than the official image:
$ docker image ls | grep 7.2.0
blacktop/elasticsearch 7.2.0 625MB
docker.elastic.co/elasticsearch/elasticsearch-oss 7.2.0 768MB
Is there anything that can be done to reduce the size?
Hi, please see https://openjdk.java.net/jeps/310. It reduces startup times and memory usage. Great for docker!
Hi! Thanks for these excellent images of ES et al! We are using your images as a base for building our own that we include some plugins in. Sadly, you only tag with major/minor version of the ES version and do not include the fix version on the docker image tags. This causes us problems as plugins must be compatible with the full three digit version number. (so a plugin that is registered to work with 6.0.0 will not work with 6.0.1).
Do you think it is possible to tag your images with the full version (i.e 6.0.0 instead of 6.0?)
That would be sweet. :)
Is there a way to change the default credentials during startup? For example in the official postgres image I could change the default credentials by passing environment variables, e.g. POSTGRES_USER
and POSTGRES_PASSWORD
. Great work on this image btw.
Hello,
I downloaded the 7.6 version Dockerfile locally and basically commented the final CMD so that I can connect inside the container (potentially add some source code). But the issue is, when I launch elastic using /elastic-entrypoint.sh elasticsearch
I can't seem to access elasticsearch from INSIDE the container (curling from outside the container i.e my laptop is working). Seems like it's some networking issue with the configuration file.
Can you please help me on this ?
Hi @blacktop!
Setting password by the ENV - ELASTIC_PASSWORD
doesn't work because of the condition -
false
as this folder doesn't present in a folder /usr/share/elasticsearch/bin
root@elasticsearch:/# ls -la /usr/share/elasticsearch/bin/
total 19604
drwxr-xr-x. 2 root root 4096 Mar 5 16:53 .
drwxr-xr-x. 1 root root 32 Mar 5 16:53 ..
-rwxr-xr-x. 1 root root 1915 Feb 29 00:23 elasticsearch
-rwxr-xr-x. 1 root root 491 Feb 29 00:23 elasticsearch-certgen
-rwxr-xr-x. 1 root root 483 Feb 29 00:23 elasticsearch-certutil
-rwxr-xr-x. 1 root root 982 Feb 29 00:23 elasticsearch-cli
-rwxr-xr-x. 1 root root 433 Feb 29 00:23 elasticsearch-croneval
-rwxr-xr-x. 1 root root 4280 Feb 29 00:23 elasticsearch-env
-rwxr-xr-x. 1 root root 1828 Feb 29 00:23 elasticsearch-env-from-file
-rwxr-xr-x. 1 root root 121 Feb 29 00:23 elasticsearch-keystore
-rwxr-xr-x. 1 root root 440 Feb 29 00:23 elasticsearch-migrate
-rwxr-xr-x. 1 root root 126 Feb 29 00:23 elasticsearch-node
-rwxr-xr-x. 1 root root 172 Feb 29 00:23 elasticsearch-plugin
-rwxr-xr-x. 1 root root 431 Feb 29 00:23 elasticsearch-saml-metadata
-rwxr-xr-x. 1 root root 438 Feb 29 00:23 elasticsearch-setup-passwords
-rwxr-xr-x. 1 root root 118 Feb 29 00:23 elasticsearch-shard
-rwxr-xr-x. 1 root root 427 Feb 29 00:23 elasticsearch-sql-cli
-rwxr-xr-x. 1 root root 19982467 Feb 29 00:23 elasticsearch-sql-cli-7.6.1.jar
-rwxr-xr-x. 1 root root 426 Feb 29 00:23 elasticsearch-syskeygen
-rwxr-xr-x. 1 root root 426 Feb 29 00:23 elasticsearch-users
-rwxr-xr-x. 1 root root 346 Feb 29 00:23 x-pack-env
-rwxr-xr-x. 1 root root 354 Feb 29 00:23 x-pack-security-env
-rwxr-xr-x. 1 root root 353 Feb 29 00:23 x-pack-watcher-env
root@elasticsearch:/#
Could you please fix it?
Thanks!
Hi @blacktop!
Looks like image blacktop/elasticsearch:x-pack-7.6.1
based not on Alpine Linux
as I expected but on Debian. Here the proof:
Alpine Linux
?Hi, firstly thank you for managing these docker images, we find them immensely useful.
I was wondering when an image for 7.16.2 might be available?
7.16.2 contains the log4j fixes (not that the recent issues effect elasticsearch) and we are being hit with quite a few false positives from vulnerability scanners picking up the package.
Thanks again :)
Hello,
I get allways errors like:
data_2 | error: exec: "data": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
data_2 | error: exec: "data": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
data_2 | error: exec: "data": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
ingest_1 | error: exec: "ingest": executable file not found in $PATH
master_1 | error: exec: "master": executable file not found in $PATH
When I try to run the 6.8 image on my computer (Macbook Pro M1), it fails with :
Unrecognized VM option 'UseAVX=1'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Would it be ok to remove the -XX:UseAVX=1
flag in the jvm options to make it compatible ?
I assume some plugins or modules weren't included?
the official build from ES supports POST _sql
curl -XPOST "http://localhost:9200/_sql" -H 'Content-Type: application/json' -d'{ "query": "SELECT parameters.gen FROM performance"}'
{"error":"Incorrect HTTP method for uri [/_sql] and method [POST], allowed: [PUT, GET, DELETE, HEAD]","status":405}
Hi!
Does this cool alpine repo intentionally not support patch versions?
For example, there are 7.9.1 and 7.9.2 in the official elastic repo.
Thanks.
The document provides a cluster running on the same host, but does not support different host clusters,
Will you be able to provide the configuration, for example:
docker run -d -e "cluster.name=ES" -e "node.name=Node_ES1" -e "network.host=192.168.0.1" -e "network.publish_host=192.168.0.1" -e "discovery.zen.minimum_master_nodes=3" -e "discovery.zen.ping.unicast.hosts=["192.168.0.2:9300", "192.168.0.3:9300", "192.168.0.4:9300"]" ......
People with common home servers like ODroids or Raspberry Pis who are wanting to run Dockerised Elasticsearch on an ARM CPU currently have to try hack together something of my own and can't use this image. The build artifacts on their download page should support ARM already, so this shouldn't be much work.
Alpine versions prior to version 3.13 use HTTP URLs in /etc/apk/repositories
. This makes the images vulnerable to simple DNS hijacking attacks and prevents using them in environments which do not allow plain HTTP connections.
Would it be possible to upgrade these images to use Alpine 3.13?
Hello,
I'm trying to add the "analysis-icu" plugin to the "blacktop/elasticsearch:8.1.2" image, below my dockerfile
FROM blacktop/elasticsearch:8.1.2
RUN elasticsearch-plugin install analysis-icu
But on image build i'm having this error :
#5 [2/2] RUN bin/elasticsearch-plugin install analysis-icu
#5 sha256:8e7998a4caf95a423a2aca933e63c0eeb6e0dd54a2e1e9f1e334b7a4416bf8c2
#5 0.318 could not find java in bundled JDK at /usr/share/elasticsearch/jdk/bin/java
#5 ERROR: executor failed running [/bin/sh -c bin/elasticsearch-plugin install analysis-icu]: exit code: 1
After checking within the base image container it seems the right possible paths are :
I tried to force the JAVA_HOME as below, but it doesn't seems to fix my error ๐
FROM blacktop/elasticsearch:8.1.2
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk/bin/java
RUN elasticsearch-plugin install analysis-icu
What would be the right way to add an ES plugin to this docker image ?
Thanks in advance for your help !
Why not make a MySQL image
:D
Based on my explanations in [1]'s commit message below,
the code as per Title here is now required -as in [2]:
[1] https://gerrit-review.googlesource.com/c/gerrit/+/287983
[2] https://gerrit-review.googlesource.com/c/gerrit/+/287983/3/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java
So without this change, such simple application code fails -this way:
(...) org.junit.AssumptionViolatedException: Unable to start container
(...) Caused by: java.lang.IllegalStateException:
Failed to verify that image 'blacktop/elasticsearch:6.8.9' is a
compatible substitute for 'docker.elastic.co/elasticsearch/elasticsearch'.
This generally means that you are trying to use an image that
Testcontainers has not been designed to use. If this is deliberate, and
if you are confident that the image is compatible, you should declare
compatibility in code using the `asCompatibleSubstituteFor` method.
For example: DockerImageName myImage =
DockerImageName.parse("blacktop/elasticsearch:6.8.9")
.asCompatibleSubstituteFor("docker.elastic.co/elasticsearch/elasticsearch");
and then use `myImage` instead.
Hey @blacktop ,
First, thanks for this image that has been incredibly useful for me and my team, without burning our machines with an image too big for what it does.
It seems like something went wrong for the build of the 7.3
image.
The image is only 5MB and trying to run it fails with:
standard_init_linux.go:211: exec user process caused "no such file or directory"
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
blacktop/elasticsearch 7.3 fc3e1dbdffa9 3 hours ago 5.59MB
Hello,
I'm testing your x-pack image, but apparently there is the following problem:
[2017-07-24T14:38:12,832][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: org.elasticsearch.bootstrap.BootstrapException: java.io.IOException: Cannot run program "/usr/share/elasticsearch/plugins/x-pack/platform/linux-x86_64/bin/controller": error=2, No such file or directory
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.5.0.jar:5.5.0]
Caused by: org.elasticsearch.bootstrap.BootstrapException: java.io.IOException: Cannot run program "/usr/share/elasticsearch/plugins/x-pack/platform/linux-x86_64/bin/controller": error=2, No such file or directory
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:169) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:351) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.5.0.jar:5.5.0]
... 6 more
Caused by: java.io.IOException: Cannot run program "/usr/share/elasticsearch/plugins/x-pack/platform/linux-x86_64/bin/controller": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) ~[?:1.8.0_121]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginController(Spawner.java:114) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginControllers(Spawner.java:93) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:351) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.5.0.jar:5.5.0]
... 6 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method) ~[?:1.8.0_121]
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247) ~[?:1.8.0_121]
at java.lang.ProcessImpl.start(ProcessImpl.java:134) ~[?:1.8.0_121]
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ~[?:1.8.0_121]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginController(Spawner.java:114) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginControllers(Spawner.java:93) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:351) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.5.0.jar:5.5.0]
... 6 more
I just run the following command line:
docker run -d --name elastic -p 9200:9200 blacktop/elasticsearch:x-pack
Any idea of what is going wrong?
Thanks in advance.
I'm using this Dockerfile: https://github.com/blacktop/docker-elasticsearch-alpine/blob/master/6.8/Dockerfile
when i start the container i get the following message:
warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
Anything i'm doing wrong here? Anyway to properly dismiss this message?
hello, when i run elasticsearch-alpine:6.8 , i can't find elasticsearch-users, maybe i need install elasticsearch-users? thank you very much
Hello,
There seems to be a bug in java, which causes this error when running on overlay2 docker driver
[2020-03-03T09:49:24,727][ERROR][org.elasticsearch.bootstrap.Bootstrap] Exception
java.lang.IllegalStateException: failed to obtain node locks, tried [[/usr/share/elasticsearch/data]] with lock id [0]; maybe these locations are not writable or multip
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:299) ~[elasticsearch-7.3.2.jar:7.3.2]
.....
Caused by: java.io.IOException: failed to obtain lock on /usr/share/elasticsearch/data/nodes/0
at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:221) ~[elasticsearch-7.3.2.jar:7.3.2]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:269) ~[elasticsearch-7.3.2.jar:7.3.2]
... 12 more
Caused by: java.io.IOException: Mount point not found
at sun.nio.fs.LinuxFileStore.findMountEntry(LinuxFileStore.java:105) ~[?:?]
Seems to be discussed here:
https://stackoverflow.com/questions/41022393/mount-point-not-found
https://bugs.openjdk.java.net/browse/JDK-8165852
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.