Ports not exposed in mongo container

snippet of the dockerfile

RUN chmod 644 /etc/crontab
RUN chmod 644 /etc/logrotate.d/mongo
RUN chmod +x /etc/cron.daily/logrotate
RUN chmod +x /etc/cron.hourly/logrotate

EXPOSE 27017-27117

HEALTHCHECK --interval=10s --timeout=2s CMD /usr/local/bin/healthcheck-cluster

CMD ["/usr/local/bin/run-supervisord"]

logs in issue setup :

cps@vpas-A1-bind-master-1:~$ docker container inspect mongo-s101 --format '{{ json .Config.ExposedPorts }}'
{"27017-27117/tcp":{},"27017/tcp":{}}
cps@vpas-A1-bind-master-1:~$

working setup :slight_smile:

ps@an-master:~$ docker container inspect mongo-s101 --format '{{ json .Config.ExposedPorts }}'`
{"27017/tcp":{},"27018/tcp":{},"27019/tcp":{},"27020/tcp":{},"27021/tcp":{},"27022/tcp":{},"27023/tcp":{},"27024/tcp":{},"27025/tcp":{},"27026/tcp":{},"27027/tcp":{},"27028/tcp":{},"27029/tcp":{},"27030/tcp":{},"27031/tcp":{},"27032/tcp":{},"27033/tcp":{},"27034/tcp":{},"27035/tcp":{},"27036/tcp":{},"27037/tcp":{},"27038/tcp":{},"27039/tcp":{},"27040/tcp":{},"27041/tcp":{},"27042/tcp":{},"27043/tcp":{},"27044/tcp":{},"27045/tcp":{},"27046/tcp":{},"27047/tcp":{},"27048/tcp":{},"27049/tcp":{},"27050/tcp":{},"27051/tcp":{},"27052/tcp":{},"27053/tcp":{},"27054/tcp":{},"27055/tcp":{},"27056/tcp":{},"27057/tcp":{},"27058/tcp":{},"27059/tcp":{},"27060/tcp":{},"27061/tcp":{},"27062/tcp":{},"27063/tcp":{},"27064/tcp":{},"27065/tcp":{},"27066/tcp":{},"27067/tcp":{},"27068/tcp":{},"27069/tcp":{},"27070/tcp":{},"27071/tcp":{},"27072/tcp":{},"27073/tcp":{},"27074/tcp":{},"27075/tcp":{},"27076/tcp":{},"27077/tcp":{},"27078/tcp":{},"27079/tcp":{},"27080/tcp":{},"27081/tcp":{},"27082/tcp":{},"27083/tcp":{},"27084/tcp":{},"27085/tcp":{},"27086/tcp":{},"27087/tcp":{},"27088/tcp":{},"27089/tcp":{},"27090/tcp":{},"27091/tcp":{},"27092/tcp":{},"27093/tcp":{},"27094/tcp":{},"27095/tcp":{},"27096/tcp":{},"27097/tcp":{},"27098/tcp":{},"27099/tcp":{},"27100/tcp":{},"27101/tcp":{},"27102/tcp":{},"27103/tcp":{},"27104/tcp":{},"27105/tcp":{},"27106/tcp":{},"27107/tcp":{},"27108/tcp":{},"27109/tcp":{},"27110/tcp":{},"27111/tcp":{},"27112/tcp":{},"27113/tcp":{},"27114/tcp":{},"27115/tcp":{},"27116/tcp":{},"27117/tcp":{}}
ps@an-master:~$

Instead of unformatted snippets, it is probably better to explain your overall goal and to provide full formatted Dockerfile, compose file and docker info, so we can understand the full picture.

I formatted your message. Please, take a look at our formatting guide and use code blocks next time: How to format your forum posts

Regrding the question, I’m not sure what we could say. You shared a Dockerfile and the output of a working and a non-working result, but we don’t know how you got both outputs. You just inspected two containers with the same name.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.