【问题标题】:I can't connect to my hugo site on docker我无法在 docker 上连接到我的 hugo 站点
【发布时间】:2020-04-02 18:51:09
【问题描述】:

最近我创建了一个 docker 并在那里创建了一个 hugo 站点,当我启动页面时出现问题,但导航器中没有收费。我是新手,所以我迷路了。

这是我启动网站时显示的内容:

WARN 2019/12/09 16:15:11 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

                   | EN  
+------------------+----+
  Pages            |  4  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     | 17  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 6 ms
Watching for changes in /cvcontainer/cv-online/{archetypes,content,data,layouts,static,themes}
Watching for config changes in /cvcontainer/cv-online/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

【问题讨论】:

  • 您好,欢迎来到 SO。 I created a docker and there I created a hugo site => 你是怎么做到的?你的 dockerfile 的内容是什么?你是如何建立你的形象的?你用什么命令来启动你的容器?您是否将端口 1313(似乎被 hugo 使用)映射到主机上的端口?您究竟使用哪个地址在浏览器中显示该站点?你到底看到了什么(连接被拒绝,没有路由到主机......)?...请编辑您的问题并添加更多信息。目前的情况,帮不了你。

标签: docker hugo


【解决方案1】:

尝试在运行服务器时添加--bind 0.0.0.0。例如。 CMD ["hugo", "server", "--bind=0.0.0.0"].

【讨论】:

  • 这解决了我的问题,但它有什么作用?什么是“绑定”。我想自学。
猜你喜欢
  • 2017-04-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-23
  • 2018-11-13
  • 1970-01-01
相关资源
最近更新 更多