Search code examples
windowsdocker-composejekyll

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


I am unable to build the jekyll site on Windows 10 using docker-compose up . I've looked at most SO posts 1regarding this error, but none of the solutions have worked for me.

The same project I can run it successfully on Mac OS

  • I tried to upgrade to jekyll-paginate-v2 2.0.0 as I am using jekyll-paginate 1.1.0

  • I am able to build the site using bundle exec jekyll serve. This command successfully creates the _site folder.

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-compose:

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

DockerFile:

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/

Solution

  • the root cause of why the website local dev environment is working on Linux but not on Windows: On Linux, folders with different cases are treated as different, on windows they are treated as the same. So while "INSPIRE" and "inspire" are different on Linux, they aren't on Windows. Unifying the writing of all tags solved the problem. There were also many more than just the INSPIRE/inspire tags that collided.

    Solution: unified all the tags