我的操作系统是Windows 7,我正在使用Docker Toolbox。我正在关注this教程,但是在尝试打开网页时我遇到了困难,因为我的浏览器说它无法建立连接。
variables.env(其余为默认值):
# Application
WEB_DOCUMENT_ROOT=/project/public
WEB_ALIAS_DOMAIN=localhost
APPLICATION_CACHE=/project/cache
APPLICATION_LOGS=/project/logs
# production | development | staging | testing
APPLICATION_ENV=development
主机:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost
然后我发现有一个名为Kitematic的程序已经与Docker Tools一起安装,因此我打开它并查看了所有容器。我去了“wildlife_app_1”这是我的网络服务器,看到一个控制台,里面有警告:
[WARNING] WEB_DOCUMENT_ROOT does not exists with path "/project/public"!
有一个名为“exec”的按钮允许打开容器的终端,所以我打开它,我发现实际上没有“/ project”中的“public”这样的目录。
有谁知道如何解决这个问题?提前谢谢!
答案 0 :(得分:1)
您必须在hosts
文件中使用您的主机(本地计算机IP),例如。 192.168.1.129
。注意:这里只是192.168.1.129
IP地址。
您经常可以使用命令提示符或终端快速查找信息。在Windows中,您可以打开“开始”菜单,搜索“命令提示符”,然后按Enter键。然后在出现的命令提示符中键入ipconfig
,然后按Enter键 - 您将立即获得所需内容。
答案 1 :(得分:1)
以下是解决方法而非解决方案,但无论如何。我已经改变了"。"配置文件中的点,带有项目目录的绝对路径。
在:
- ./application:/project
- ./cache:/project/cache
- ./logs:/project/logs
后:
- C:/Users/Dmitriy/Desktop/projects/Wildlife/application:/project
- C:/Users/Dmitriy/Desktop/projects/Wildlife/cache:/project/cache
- C:/Users/Dmitriy/Desktop/projects/Wildlife/logs:/project/logs
它现在有效。