Docker Community Forums

Share and learn in the Docker community.

Docker container from image command with or without port mapping?


#1

Hi
Docker running on windws 10 pro, 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

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?

However when I run netstat -b I see:
[memcached.exe]
TCP 127.0.0.1:11210 MKRUSTEV:49955 ESTABLISHED
[memcached.exe]
TCP 127.0.0.1:11210 MKRUSTEV:49958 ESTABLISHED
[memcached.exe]
TCP 127.0.0.1:11210 MKRUSTEV:49959 ESTABLISHED
[memcached.exe]
TCP 127.0.0.1:11210 MKRUSTEV:49972 ESTABLISHED
[memcached.exe]

Any help would be extremely appreciated! :slight_smile:
Thanks


#2

FIgured it out - had installed Couchbase previously on host machine… Removed it and all is fine.


(Ove "Lime" Lindström) #3

Please mark issue as solved.