Creating Couchbase container in Docker - do I need to explicitly map ports


#1

Hi
Docker running on windws, I have couchbase image which I’d like to run, looking at the provided info I should use the following command:
docker run -d --name cb1 -p 8091-8094:8091-8094 -p 11210:11210 couchbase

However, I get an error saying that the 11210 port is already allocated.

So, I run this command instead:
docker run -d --name cb1 couchbase

Now it looks like things are good, however, as I am new to this I wonder what’s the difference between the two commands and should I expect rpoblems, using the shorter command and not mapping those ports explicitly?

Thanks!


#2

Figured it our - had installed Couchbase on host previously - that was causing the conflict…


#3

Hi @mkrustev,

I’m glad you figured it out. Just in case someone else comes across this post, all the ports that Couchbase uses are documented here: https://docs.couchbase.com/server/6.0/install/install-ports.html


#4

Hi @mkrustev, Also take a look at the Couchbase Autonomous Operator for Kubernetes which is best way to run Couchbase on Containers - https://docs.couchbase.com/operator/1.1/overview.html

Anil Kumar