Problem:
Dockerfile reports that yum cannot be used, as shown in the figure:
Solution:
vim /etc/sysctl.conf
net.ipv4.ip_forward=1 ##添加路由转发
Or:
vim /usr/lib/sysctl.d/00-system.conf
net.ipv4.ip_forward=1
Restart the network card and test again.
Recommended related tutorials: docker tutorial
The above is the detailed content of What to do if yum cannot be used in docker. For more information, please follow other related articles on the PHP Chinese website!