wordpress - Docker中的Wordpress无法连接到Internet

标签 wordpress docker

我在容器内的wordpress无法连接到Internet,因此,如果我执行安装插件之类的操作,则会收到以下错误消息:

“Installation failed: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.”.



有人帮我吗?我认为它需要一些网络选项……我使用docker而不是docker-compose,并使用以下命令运行实例:
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -d mysql:5.7

docker run --name wordpress --link mysql -p 80:80 -d wordpress

可以,但wordpress无法连接到Internet。
如果有用的话,我在Docker内部配置了一个代理。
非常感谢你。

最佳答案

如果Docker引擎使用代理服务器,则以下标志可以解决问题:

--network=host

关于wordpress - Docker中的Wordpress无法连接到Internet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53279209/

相关文章:

python - 使用 docker exec_run python docker client 将文件传递到容器

oracle - 登录sqlplus,执行dockerfile中的sql文件

css - 如何在 tyche 主题 wordpress 上修复 Slider

php - 通过 wp_insert_post Wordpress 将 ı,ş,ç 等特殊字符保存到数据库中

css - 右对齐 FB,如 wordpress 标题中的按钮

docker - 如何通过 Docker Hub API 确定标签的 Docker 镜像 ID?

javascript - Dockerfile,在dev/prod之间切换

mysql - 如何搜索和替换数据库中字符串的所有实例?

css - 联系表格 WP 插件不显示提交按钮

docker - 防止更改无根容器安装中的权限