Docker on Windows 10 Pro: error file conflict when building new Jekyll site

时间:2018-06-04 17:31:44

标签: docker docker-compose containers jekyll jekyll-theme

I am using PowerShell on Windows 10 Pro and have installed Docker version 18.03.1-ce.

I CD into a local directory where I want to edit a set of config files to build my Jekyll webpage. I ran the following command:

docker run -e JEKYLL_NEW=true -p 80:4000 -v ${pwd}:/site bretfisher/jekyll-serve

and the the following message:

NOTE: making new jekyll site!
          Conflict: /site exists and is not empty.
                    Ensure /site is empty or else try again with `--force` to proceed and overwrite any files.

If I use the --force flag inside the call above it tells me unknown flag. Anyone has any idea how to fix this and successfully build a jekyll container linked to my local directory of files to be able to edit and preview on localhost in the browser before pushing it into production?

1 个答案:

答案 0 :(得分:2)

请密切注意Jekyll quick start中的步骤。在第3步中,Jekyll为您的网站创建目录。该错误消息告诉您,已经存在一个包含文件的site目录,因此Jekyll退出而不是覆盖现有文件。如果删除该目录的内容或将其移动到其他位置,则可以继续执行jekyll new命令。

顺便说一句,您可以尝试选择其他站点名称。 Jekyll创建自己的_site目录,在此目录中为您的网站放置了构建的HTML文件。当您拥有site/_site目录时,您会感到困惑。