2015-10-14 50 views

回答

3

一旦泊塢窗運行 - P完成後,容器正在運行,with the EXPOSE(d) port mapped to an high port number on the host

要獲取正在運行的容器的任何信息,請使用docker inspect

如果您知道容器內部端口號(當時被映射),您可以輸入(from this comment):

docker inspect --format '{{ (index (index .NetworkSettings.Ports "8080/tcp") 0).HostPort }}' <Container-Name/ID> 

offical Jenkins image uses EXPOSE 8080

+0

非常感謝VonC,我會進一步檢查'docker inspect'命令及其提供的信息。 –

+0

謝謝VonC,它的工作原理與我想要的完全一樣。也許你想在命令末尾添加'Container-Name/ID'來澄清。 –

+0

@KostasDemiris的確,我已經編輯了相應的答案。 – VonC

相關問題