fuxkcsdn
V2EX  ›  Docker

基于第三方 image build 的时候, EXPOSE 会把原始 image 里的端口也带上,如何禁止这行为?

  •  
  •   fuxkcsdn · Mar 14, 2017 · 2895 views
    This topic created in 3365 days ago, the information mentioned may be changed or developed.

    第三方的 Dockerfile 中有 EXPOSE 1234

    当使用其 build 后的 image 作为基础镜像时

    FROM 3rd/image:latest
    
    # balabalabala...
    
    EXPOSE 1122
    

    run 的时候会看到 PORTS 中有 1234/TCP

    除了基于第三方 image 的 Dockerfile 进行修改外,还有其他什么方法可以在 build image 时禁止这行为吗?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2959 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:19 · PVG 22:19 · LAX 07:19 · JFK 10:19
    ♥ Do have faith in what you're doing.