1
votes

I am trying to upload the json to a local couchbase server in docker.

For that, I am using the below-mentioned content in docker file

From couchbase

ADD lines2.json /

RUN echo "1 - PWD"$pwd

WORKDIR opt/couchbase/bin

RUN echo "2 - PWD "$PWD


CMD ["cbimport", "json", "-u", "Administrator", "-p", "password", "-b", "sample", "-c", "couchbase://localhost", "-f", "lines", "-d", "file:///lines2.json", "-g", "key::%name%", "-t", "4"] 

Getting the error as:

Json import failed: Rest client error (GET http://localhost:8091/pools): dial tcp 127.0.0.1:8091: getsockopt: connection refused

Please help me out on solving the issue

Thanks

1

1 Answers

0
votes

Run below: *docker exec -it db bash *hostname

Copy the hostname (for example, 93871f306931) and replace "couchbase://localhost" by that hostname