Comments (2)
事实上这个问题跟容器中的alpine无关.而跟docker0这张docker daemon生成的虚拟网卡有关系.如果docker0这张vNIC得到并且绑定了宿主机上IPv6的地址.并且配置的路由默认是使用IPv6的.那么在内部容器对外访问的时候就会优先使用IPv6的地址.
- 如果你想让容器访问的网络是纯ipv4的话.你可能需要在docker daemon的启动参数中加入
ipv6=false
或者修改/etc/docker/daemon.json
加入以上参数.或者使用特定的sysctl参数禁用IPv6访问. - 如果要设置ipv4优先.可以考虑修改宿主机中的相应路由.使得默认路由通过ipv4链路.
from dockerfiles.
可以参考这个issue中的相关讨论
from dockerfiles.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockerfiles.