Home >Operation and Maintenance >Docker >The docker image started successfully, but it cannot be accessed. What happened?

The docker image started successfully, but it cannot be accessed. What happened?

王林
王林forward
2020-12-02 14:58:025408browse

The docker image started successfully, but it cannot be accessed. What happened?

Problem:

The docker image started successfully but cannot be accessed.

(Related recommendations: docker tutorial)

Solution:

vi /etc/sysctl.conf

or

vi /usr/lib/sysctl.d/00-system.conf

Add the following code:

net.ipv4.ip_forward=1

Restart the network service

systemctl restart network

Check whether the modification is successful

sysctl net.ipv4.ip_forward

If the return value is "net.ipv4.ip_forward = 1", it means success.

The above is the detailed content of The docker image started successfully, but it cannot be accessed. What happened?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete