jekyll 3.8.4 | Error: File exists @ dir_s_mkdir - /jekyll/app/_site/tag/mytags

jekyll 3.8.4 | Error: File exists @ dir_s_mkdir - /jekyll/app/_site/tag/mytags

我无法使用 docker-compose upWindows 10 上构建 jekyll 站点。我查看了大多数关于此错误的 SO 帖子 1,但是 none 的解决方案对我有用。

同一个项目我可以运行在MacOS

上成功
site_1  | 11:49:16 webpack.1 |     Entrypoint undefined = ../../app/_layouts/default.html
site_1  | 11:49:16 webpack.1 |        4 modules
site_1  | 11:49:16 webpack.1 | ��� ���wdm���: Compiled successfully.
site_1  | 11:49:39 webpack.1 | ��� ���wdm���: Compiling...
site_1  | 11:49:42 jekyll.1  | exited with code 1
site_1  | 11:49:42 system    | sending SIGTERM to all processes
site_1  | 11:49:44 webpack.1 |  98% after emitting CopyPlugin
site_1  | 11:49:44           | jekyll 3.8.4 | Error:  File exists @ dir_s_mkdir - /jekyll/app/_site/tag/inspire
site_1  | 11:49:44 webpack.1 | exited with code 0

Docker-撰写:

version: '3'
volumes:
  app-gems:
    driver: local
services:
  site:
    build:
      context: ./dev
      dockerfile: Dockerfile
    volumes:
      - .:/jekyll/app
      - app-gems:/usr/local/bundle
    environment:
      - NODE_ENV=develop
    command: ./app/dev/scripts/serve.sh
    stdin_open: true
    tty: true

Docker文件:

FROM ruby:2.5-stretch as builder

ARG APP_URL
ENV NODE_VER 8
ENV APP_HOME /app
ENV JEKYLL_APP_DIR /app
ENV NODE_ENV production

RUN sed -i "s/stretch main/stretch main contrib non-free/" /etc/apt/sources.list \
    && curl -sL https://deb.nodesource.com/setup_$NODE_VER.x | bash - \
    && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -\
    && echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list \
    && apt-get update && apt-get install -y libxml2-dev libxslt1-dev unzip imagemagick nodejs cmake yarn \
    && npm install -g bower \
    && rm -rf /var/lib/apt/lists/*

WORKDIR $APP_HOME
COPY . .
RUN ./dev/scripts/build.sh && cat app/_layouts/default.html

FROM nginx:1.14-alpine
ENV NGINX_PORT 3000
COPY --from=builder /app/_site /usr/share/nginx/html
RUN ls -la /usr/share/nginx/html/

关于Error: File exists @ dir_s_mkdir我猜是因为使用了绑定挂载(卷- .:/jekyll/app),我对jekyll了解不多,但是该目录中的所有内容都应该保留吗?在那种情况下你不能使用命名卷吗?

网站本地开发环境在Linux上运行但在Windows上不运行的根本原因:在Linux上,不同大小写的文件夹被视为不同,在windows 他们被当作一样对待。因此,虽然“INSPIRE”和“inspire”在 Linux 上有所不同,但它们在 Windows 上并不相同。统一所有标签的书写解决了这个问题。发生冲突的不仅仅是 INSPIRE/inspire 个标签。

解决方法:统一所有标签