PublishAllPorts: don't crash with nil PortBindings by robmry · Pull Request #51621 · moby/moby (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same should work for a container --expose ... I did it this way because the build command in the test was trivial, and it seemed more likely to be testing something a user would do (I'm guessing --expose with a -P on the container is unusual, compared with -p).

The test runs in < 1s, but the build is a bit log-spammy. Can change it, or test both ways?