Skip to content

Override EXPOSE from parent Dockerfile #2210

@yukw777

Description

@yukw777

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``

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions