Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override EXPOSE from parent Dockerfile #2210

Closed
yukw777 opened this issue Oct 14, 2013 · 9 comments
Closed

Override EXPOSE from parent Dockerfile #2210

yukw777 opened this issue Oct 14, 2013 · 9 comments

Comments

@yukw777
Copy link

yukw777 commented Oct 14, 2013

Sometimes when you create a Dockerfile from another "parent" Dockerfile, you want to use new port mappings that are different from those from the parent Dockerfile. For example, in the parent Dockerfile, I expose port 22 for ssh, but in a child Dockerfile, I want to close it up and use port 5555 instead. I'm imagining something like this:

// parent
EXPOSE 22``

// child
FROM parent
// just close port 22
CLOSEPORT 22

or

// child
FROM parent
// just close all the ports
CLOSEPORT``

@SvenDowideit
Copy link
Contributor

CLOSEPORT isn't exactly the opposite of EXPOSE, but then, OPENPORT would probably be a better INSTRUCTION

what about Apache.conf style?

EXPOSE -22 +5555

@yukw777
Copy link
Author

yukw777 commented Oct 15, 2013

OPENPORT vs CLOSEPORT makes sense. I like the Apache style too for its conciseness. I think we should go with the one that's easier to implement.

@joelreymont
Copy link

I'll take it.

@crosbymichael
Copy link
Contributor

@yukw777 @SvenDowideit

What if I don't want people to override the settings that I specify in my images? Shouldn't the parent image dictate and child images extend?

@joelreymont
Copy link

EXTEND OFF in the parent Dockerfile?

A new verb, not implemented yet ;-).

@yukw777
Copy link
Author

yukw777 commented Oct 23, 2013

@wagerlabs @crosbymichael

Maybe PORTFREEZE? EXTEND OFF sounds like you can't do anything in the child.

@shykes
Copy link
Contributor

shykes commented Jan 6, 2014

This seems to be a generic problem: resetting image properties to drop the inheritance and start from scratch. This applies to expose but also to cmd, entrypoint, volume and so on.

I would prefer seeing a generic solution to this problem.

@shykes
Copy link
Contributor

shykes commented Jan 6, 2014

Closing in favor of the more generic #3465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants