And when I call docker compose up, It gives that error
[couchbase 3/3] RUN couchbase-cli cluster-init --cluster-username Administrator --cluster-password password --services data,index,query --cluster-ramsize 512 --cluster-index-ramsize 256: #0 0.886 ERROR: Unable to connect to host at http://127.0.0.1:8091: HTTPConnectionPool(host=â127.0.0.1â, port=8091): Max retries exceeded with url: /pools (Caused by NewConnectionError(â<urllib3.connection.HTTPConnection object at 0x7f7b37f35ee0>: Failed to establish a new connection: [Errno 111] Connection refusedâ))
What will be the problem, thanks for reading and answering
I understand. It doesnât require using the UI, thatâs just the examples that are provided.
You should still be able to do what youâre looking to do. Iâm not sure exactly why the couchbase-cli command is failing within the dockerfile, I suspect it either has to do with not waiting long enough for the server to have finished starting up, or perhaps itâs trying to reference the wrong IP (though Iâd think 127.0.0.1 should work properly from within the container). Can you add a â-vvâ to the couchbase-cli command to see what the extended output is? And, just as a test, are you able to access the node through the UI to confirm itâs up and running?
Both of the above have extracted the couchbase-cli commands into a separate script that runs rather than embedding the commands into the dockerfile.
Lastly, if your goal here is integrated testing from your applicaiton, Iâd suggest looking at using testcontainers which handles all of this for you: Couchbase Module - Testcontainers for Java
Hello, thanks for replies again, It says unrecognized arguments: -vv
Both of the above have extracted the couchbase-cli commands into a separate script that runs rather than embedding the commands into the dockerfile.
I am trying to achieve this using only dockerfile. When I disable run command in dockerfile I can visit UI through browser. It greets me with Start New Cluster.
My purpose is try CDC on couchbase with my current data.
After reading about docker, it seems impossible to cluster init in dockerfile with CMD or RUN commands, Special shell script required to accomplish it, which runs entrypoint.sh along side