0

I have a 4 lines dockerfile. The first 3 commands work as expected. But I get an error on the 4th line.

FROM elasticsearch
RUN wget https://dumps.wikimedia.org/other/cirrussearch/20160215/emlwiki-20160215-cirrussearch-content.json.gz
RUN gunzip emlwiki-20160215-cirrussearch-content.json.gz

RUN curl -s -XPOST localhost:9200/wikipedia_content/somelan/_bulk --data-binary @emlwiki-20160215-cirrussearch-content.json

How do I execute curl command in dockerfile?

1 Answer 1

1

localhost:9200 is the host/ip of your container, not your docker host. Since you didn't RUN anything that would listen on port 9200, I suspect you want to pull content from the host.

Typically you'd have another container listening on 9200, you'd reference it by the container name, and you'd start both containers with docker-compose.

To pull from your host, you need to include the IP or hostname of your docker host instead of localhost.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.