Closed nickchen120235 closed 2 years ago
It seems more likely to be a bug from the docker image rather than from the theme.
Can you share the dockerfile and the complete logs when you do docker run
?
Dockerfile (from its GitHub repo)
FROM ruby:2-slim-bullseye as jekyll
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# used in the jekyll-server image, which is FROM this image
COPY docker-entrypoint.sh /usr/local/bin/
# install both bundler 1.x and 2.x incase you're running
# old gem files
# https://bundler.io/guides/bundler_2_upgrade.html#faq
RUN gem install bundler -v "~>1.0" && gem install bundler jekyll
EXPOSE 4000
WORKDIR /site
ENTRYPOINT [ "jekyll" ]
CMD [ "--help" ]
# build from the image we just built with different metadata
FROM ghcr.io/bretfisher/jekyll:latest as jekyll-serve
# on every container start, check if Gemfile exists and warn if it's missing
ENTRYPOINT [ "docker-entrypoint.sh" ]
CMD [ "bundle", "exec", "jekyll", "serve", "--force_polling", "-H", "0.0.0.0", "-P", "4000" ]
The complete log is the one attached in the first comment.
I also tried adding git
while doing apt install
but still didn't work.
Describe the bug When loading the gemspec file, the following error is shown.
To Reproduce
docker run --network bridge -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve
Expected behavior The site should be successfully
serve
d.Additional context After some googling, some suggest that
git ls-files
is not a recommended way to load files sincegit
may not be presentfor some reasonon target machine. I'm working on a PR that replaces the command withDir["**/*"]
, which by my limited ruby knowledge, is equivalent to the current method.