Is there a way to "UNEXPOSE" a port in Dockerfile?

I am trying to deploy a mosquitto MQTT broker in our corporate cloud through docker image. The allowed ports that are exposed are in the range of 10000-10999. By default eclipse-mosquitto image exposes port 1883. Is there a way to unexpose port 1883 and expose 10883? This is my Dockerfile :

FROM eclipse-mosquitto:latest

COPY mosquitto.conf /mosquitto/config/
COPY docker-entrypoint.sh mosquitto-no-auth.conf /
EXPOSE 10883
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/sbin/mosquitto", "-c", "/mosquitto/config/mosquitto.conf"]

EXPOSE instructions have a merly documentational character. Some management tools detect them and pre-populate them as target for port mappings settings when creating a container (e.g. like the Synology Docker-UI).

By itself the EXPOSE instruction has no effect on a container created from the image. Only published ports have :slight_smile: