Ports not exposed in mongo container

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.