-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you're looking for a maintained alternative to this repository #74
Comments
As described in the Gemfile, if "github-pages" gem is used, the "jekyll" one should be commented out. Failure to do so leads to the generation of an incomplete site unable to reference its style-sheet. References: * https://github.com/github/pages-gem * Starefossen/docker-github-pages#74 (comment)
As described in the Gemfile, if "github-pages" gem is used, the "jekyll" one should be commented out. Failure to do so leads to the generation of an incomplete site unable to reference its style-sheet. References: * https://github.com/github/pages-gem * Starefossen/docker-github-pages#74 (comment)
Until yesterday used starefossen, but now I get a segmentation fault because of arm. Guess because of an update. Trying this solution, I get an error "cannot load such file", because "webrick is not part of the default gems since Ruby 3.0.0. Install webrick from RubyGems." |
This is how I use the pages-gem docker image:
git clone https://github.com/github/pages-gem
cd pages-gem
git checkout v229
docker build -t gh-pages .
In order for this to work a Gemfile like this is required in the site root: source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
gem 'webrick', '~> 1.8' The explicit dependency on webrick is required since the docker image in v229 was updated to Ruby 3. |
@pmarinova I tried the instructions you suggested - built
This is my
I tried adding Also tried running with this
But that also didn't work: $ docker build -t my-blog .
$ docker run --rm -it -p 4000:4000 -v ${PWD}:/src/site my-blog
Resolving dependencies...
/usr/local/lib/ruby/3.3.0/bundler/definition.rb:596:in `materialize': Could not find nokogiri-1.16.3-x86_64-linux, racc-1.6.2, i18n-1.14.4, rexml-3.2.5, activesupport-7.1.3.2, concurrent-ruby-1.2.3, base64-0.1.1, bigdecimal-3.1.3, drb-2.1.1, minitest-5.16.3, mutex_m-0.1.2, ffi-1.16.3, rb-inotify-0.10.1 in cached gems or installed locally (Bundler::GemNotFound)
from /usr/local/lib/ruby/3.3.0/bundler/definition.rb:203:in `specs'
from /usr/local/lib/ruby/3.3.0/bundler/definition.rb:270:in `specs_for'
from /usr/local/lib/ruby/3.3.0/bundler/runtime.rb:18:in `setup'
from /usr/local/lib/ruby/3.3.0/bundler.rb:162:in `setup'
from /usr/local/bundle/gems/jekyll-3.9.5/lib/jekyll/plugin_manager.rb:50:in `require_from_bundler'
from /usr/local/bundle/gems/jekyll-3.9.5/exe/jekyll:11:in `<top (required)>'
from /usr/local/bundle/bin/jekyll:25:in `load'
from /usr/local/bundle/bin/jekyll:25:in `<main>' Adding the mentioned gems (eg. Do you have any idea how this issue can be solved?? |
@sohang3112 Have you tried deleting the Gemfile.lock file and starting it clean? |
Why: - It crashes with "Segmentation fault" on M3 Macbook. Looks like it's not compatible with ARM. Related issue: Starefossen/docker-github-pages#74 - Consider adapting the docker image (ghcr.io/actions/jekyll-build-pages) that GitHub uses for building the site in GitHub Actions. - Consider merging the front page and user guide into the application, and get rid of the Jekyll site.
What would this look like using docker compose? |
@mikecole, thanks for suggesting to use a docker compose file, here it is: services:
gh-pages:
build:
context: https://github.com/github/pages-gem.git#v231
dockerfile: Dockerfile.alpine
command: sh -c "bundle install && jekyll serve -H 0.0.0.0 -P 4000"
ports:
- "4000:4000"
volumes:
- "./:/src/site" Place this in a Make sure to delete your |
@pmarinova Confirmed, this worked for me. Thank you! I did slightly modify the command: |
Just curious from those who have made the change, is it still working for you? I put services:
gh-pages:
build:
context: https://github.com/github/pages-gem.git#v232
dockerfile: Dockerfile
command: sh -c "bundle install && jekyll serve --watch --force_polling -H 0.0.0.0 -P 4000"
ports:
- "4000:4000"
volumes:
- "./:/src/site" and I run that I get the output of,
Unsure if that fatel error is a problem as I am in a subdirectory. If I save a file I see regeneration working,
But the rendered site is just the markdown fed into it and being served back to me 😅 I have also tried to use the alpine and non-alpine versions above, as well as v232 and v231. All seem to just serve my static site. Am I missing something? |
@beeradmoore, I had the same issues and finally realized this docker image is intended for development of the github-pages gem itself, whereas my case is to simply run a github-pages site locally. I am now using the latest version of the github-pages gem from rubygems like this: https://gist.github.com/pmarinova/0b345a2656abe079c322ad0a90a32c61 See also github/pages-gem#891 |
Thanks for the info @pmarinova I copied your
When I tried to use this I got an error of
Looking up that error lead me here with someone saying git is not on the system path. I modified your
This eventually got it to run with the output,
But as before, its just serving up my markdown pages back to me. EDIT: Nevermind, this was probably always working. I was going to EDIT 2: I had to add some other stuff to re-generate my site. I also updated ruby to 3.3.4 to match versions listed here. Here is the setup I have now,
services:
gh-pages:
build:
dockerfile: Dockerfile.alpine
ports:
- "4000:4000"
volumes:
- "./:/src/site"
|
Thanks, @beeradmoore. To be honest, I never got into too much detail about the Ruby/Jekyll setup as all I wanted was to be able to test a very simple site. So my version of the Dockerfile is the absolute minimum setup. I was actually surprised that I couldn't find any info about setting it up with a container. Perhaps someone will share a more detailed explanation of it. |
This is more up to date than starefossen/github-pages, and doesn’t have any issues with Rosetta (see Starefossen/docker-github-pages/issues/74)
This is more up to date than starefossen/github-pages, and doesn’t have any issues with Rosetta (see Starefossen/docker-github-pages/issues/74)
This is more up to date than starefossen/github-pages, and doesn’t have any issues with Rosetta (see Starefossen/docker-github-pages/issues/74)
This is more up to date than starefossen/github-pages, and doesn’t have any issues with Rosetta (see Starefossen/docker-github-pages/issues/74)
This is more up to date than starefossen/github-pages, and doesn’t have any issues with Rosetta (see Starefossen/docker-github-pages/issues/74)
A while ago I published the built Docker image from my fork of https://github.com/github/pages-gem, so you can use this to get a site up and running simply by using this in your services:
github-pages:
volumes:
- '${PWD}/docs/:/src/site/'
ports:
- '4000:4000'
image: markcrossfield/pages-gem:231-alpine You should then be able to run |
Thanks @mrmanc - that should be useful! |
@mrmanc , unfortunatly that didn't work. The webserver came up, but only gave me a file list but would never create the hosting files. I am unsure if the problem is because of this warning,
or because of
Ironically I usually use macOS (as arm64), but this particular project is Windows only so I am normally wirting docs on my Windows machine 😅 |
Why
I'm writing this issue just because I used this Docker image before (thank you Starefossen ❤️, you did a great job here), but now it does not work anymore for me... So I found a well maintained alternative that I wanted to share with other folks in this situation.
Requirements
A recent pages-gem Docker image must be available on your computer:
Go to your project directory to run your website locally
docker run -it --rm \ -p 4000:4000 \ -v $(pwd):/src/site \ gh-pages jekyll serve --watch --force_polling -H 0.0.0.0 -P 4000
The text was updated successfully, but these errors were encountered: