Handle containers without port mappings.

- Fixes #779.