[Solved] Docker Run ElasticSearch Error: docker: invalid reference format: repository name must be lowercase.

Problems encountered

When starting the elasticsearch container with docker, enter

docker run --name elasticsearch -p 9200:9200 -p 9300:9300\
-e "discovery.type=single-node"\
-e ES_JAVA_OPTS="-Xms64m -Xmx128m"\
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml\
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data\
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins\
-d elasticsearch:7.6.2

report errors

docker: invalid reference format: repository name must be lowercase.

reason:

Docker: invalid reference format: repository name must be lowercase.

There is no space before \ in the shell

Solution:

Add a space before all \, and after modification, it is as follows:

docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms64m -Xmx128m" \
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.6.2

Run successfully

Similar Posts: