Giter Site home page Giter Site logo

Comments (2)

fanvinga avatar fanvinga commented on July 24, 2024

事实上这个问题跟容器中的alpine无关.而跟docker0这张docker daemon生成的虚拟网卡有关系.如果docker0这张vNIC得到并且绑定了宿主机上IPv6的地址.并且配置的路由默认是使用IPv6的.那么在内部容器对外访问的时候就会优先使用IPv6的地址.

  • 如果你想让容器访问的网络是纯ipv4的话.你可能需要在docker daemon的启动参数中加入ipv6=false或者修改/etc/docker/daemon.json加入以上参数.或者使用特定的sysctl参数禁用IPv6访问.
  • 如果要设置ipv4优先.可以考虑修改宿主机中的相应路由.使得默认路由通过ipv4链路.

from dockerfiles.

fanvinga avatar fanvinga commented on July 24, 2024

可以参考这个issue中的相关讨论

from dockerfiles.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.