I have a docker-compose file which invokes an existing image and modifies it - the base image is from a parent project and not under my control. That base image has an EXPOSE 8080
, but one of the primary ways I am modifying it is to change the port the service uses.
How can I negate/cancel that EXPOSE
from the docker-compose.yaml
?
(Note: Future versions of the parent project are likely to update the base image and our local project will modify those future versions, so the obvious solution of "make a fork which changes the Dockerfile" is not an option. Solutions that need some other local files to override the parent are fine, as long as it's all local and not going to require resolving merge conflicts every time the base image updates.)