Trying to import sample JSON data from Couchbase Training lessons into Couchbase installed within a docker container.
Looking for the command to do this correctly.
Trying to import sample JSON data from Couchbase Training lessons into Couchbase installed within a docker container.
Looking for the command to do this correctly.
I believe I have figured this out.
to create a docker container named “db” from the “couchbase” image and mount a virtual directory named “:/couchbase-training” and map it to the current host directory on a Mac, use the following command.
docker run -v $(pwd):/couchbase-training -it -d --name db -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 couchbase
In general terms:
docker run -v $(pwd):/{virtual-directory-name} -it -d --name {container-name} -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 {docker-image-name}
Then, the cbimport for the sample data can be completed as follows:
cbimport json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file:///couchbase-training/CB121/products-data.json -t 4 -g %type%::%variety%::#MONO_INCR#
cbimport json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file:///couchbase-training/CB121/orders-data.json -t 4 -g %type%::%order_id%