1

Im new to Docker and im having an issue.

Im trying to start the pblittle/docker-logstash container using this command:

sudo docker run -d -e LOGSTASH_CONFIG_URL=pathtomyconfig --link dockerfile/elasticsearch:es -p 9292:9292 -p 9200:9200 pblittle/docker-logstash

and i am getting the following error:

Error: Could not find entity for dockerfile/elasticsearch

If i do sudo docker ps is get the following:

CONTAINER ID        IMAGE                             COMMAND                CREATED             STATUS              PORTS                                            NAMES
0021bd567d95        dockerfile/elasticsearch:latest   /elasticsearch/bin/e   7 minutes ago       Up 7 minutes        0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp   cranky_meitner2
e900cbb758a5        dockerfile/redis:latest           redis-server /etc/re   12 hours ago        Up 7 minutes        0.0.0.0:6379->6379/tcp                           redis
592a4f8d97f2        dockerfile/redis:latest           redis-server /etc/re   12 hours ago        Up 7 minutes        6379/tcp                                         cocky_thompson4

What the devil am i doing wrong? How can i work out what is going on?

1 Answer 1

2

You got the value for the --link option wrong. The --link option of the docker run command takes a container name or id as value followed by : followed by an alias (which can be whatever you want).

What you did wrong with --link dockerfile/elasticsearch:es is to pass in a Docker image name instead of a docker container name/id.

Firstly you need a running container for ElasticSearch:

sudo docker run -d -p 9300:9300 --name myelasticsearch dockerfile/elasticsearch

Then you can run your logstash container linking to the container named myelasticsearch:

sudo docker run -d -e LOGSTASH_CONFIG_URL=pathtomyconfig --link myelasticsearch:es -p 9292:9292 -p 9200:9200 pblittle/docker-logstash
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.