Francesco Tonini
Francesco Tonini

Reputation: 53

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

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?

Upvotes: 0

Views: 89

Answers (1)

Robert Del Favero
Robert Del Favero

Reputation: 141

Pay close attention to the steps in the Jekyll quick start. In step 3, Jekyll creates the directory for your web site. The error message is telling you that there's already an existing site directory with files in it, so Jekyll quits rather than overwrite existing files. If you delete the contents of that directory or move them elsewhere, your jekyll new command can proceed.

You might try picking a different site name, by the way. Jekyll creates its own _site directory where it puts the built HTML files for your site. You're asking for confusion when you have a site/_site directory.

Upvotes: 2

Related Questions