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
Add support for Docker #1488
Add support for Docker #1488
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great! Thanks for this Ulises, it will help other to be able to run this locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@UlisesGascon , I've added a small suggestion
LGTM |
Dockerfile
Outdated
@@ -0,0 +1,23 @@ | |||
# Use the official Jekyll image as the base | |||
FROM jekyll/jekyll:3.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, I try to build the docker image and it gives me a segmentation fault:
=> ERROR [5/6] RUN bundle install --no-cache && rm Gemfile.lock 0.6s
------
> [5/6] RUN bundle install --no-cache && rm Gemfile.lock:
#5 0.602 Segmentation fault
------
process "/bin/sh -c bundle install --no-cache && rm Gemfile.lock" did not complete successfully: exit code: 139
make: *** [build] Error 1
However, using this docker version solves the problem
FROM jekyll/jekyll:3.7 | |
FROM jekyll/jekyll:4.2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I only changed the version and this is my docker log
2024-04-25 08:16:21 Bundler 2.3.25 is running, but your lockfile was generated with 1.17.2. Installing Bundler 1.17.2 and restarting using that version.
2024-04-25 08:16:23 Fetching gem metadata from https://rubygems.org/.
2024-04-25 08:16:23 Fetching bundler 1.17.2
2024-04-25 08:16:23 Installing bundler 1.17.2
2024-04-25 08:16:28 Fetching gem metadata from https://rubygems.org/.........
2024-04-25 08:16:28 Using concurrent-ruby 1.2.3
2024-04-25 08:16:28 Using i18n 1.14.4
2024-04-25 08:16:28 Using minitest 5.22.3
2024-04-25 08:16:28 Using tzinfo 2.0.6
2024-04-25 08:16:28 Fetching zeitwerk 2.6.13
2024-04-25 08:16:29 Installing zeitwerk 2.6.13
2024-04-25 08:16:29 Fetching activesupport 6.1.7.7
2024-04-25 08:16:30 Installing activesupport 6.1.7.7
2024-04-25 08:16:30 Using public_suffix 5.0.5
2024-04-25 08:16:30 Using addressable 2.8.6
2024-04-25 08:16:30 Using base64 0.2.0
2024-04-25 08:16:30 Using bundler 1.17.2
2024-04-25 08:16:30 Using coffee-script-source 1.12.2
2024-04-25 08:16:30 Using execjs 2.9.1
2024-04-25 08:16:30 Using coffee-script 2.4.1
2024-04-25 08:16:30 Using colorator 1.1.0
2024-04-25 08:16:30 Using commonmarker 0.23.10
2024-04-25 08:16:30 Using unf_ext 0.0.9.1
2024-04-25 08:16:30 Using unf 0.1.4
2024-04-25 08:16:30 Using simpleidn 0.2.1
2024-04-25 08:16:30 Fetching dnsruby 1.72.0
2024-04-25 08:16:30 Installing dnsruby 1.72.0
2024-04-25 08:16:30 Using eventmachine 1.2.7
2024-04-25 08:16:30 Using http_parser.rb 0.8.0
2024-04-25 08:16:30 Using em-websocket 0.5.3
2024-04-25 08:16:30 Using ffi 1.16.3
2024-04-25 08:16:30 Using ethon 0.16.0
2024-04-25 08:16:30 Fetching faraday-net_http 3.0.2
2024-04-25 08:16:30 Installing faraday-net_http 3.0.2
2024-04-25 08:16:30 Using ruby2_keywords 0.0.5
2024-04-25 08:16:30 Fetching faraday 2.8.1
2024-04-25 08:16:31 Installing faraday 2.8.1
2024-04-25 08:16:31 Using forwardable-extended 2.6.0
2024-04-25 08:16:31 Using gemoji 4.1.0
2024-04-25 08:16:31 Using sawyer 0.9.2
2024-04-25 08:16:31 Using octokit 4.25.1
2024-04-25 08:16:31 Using typhoeus 1.4.1
2024-04-25 08:16:31 Using github-pages-health-check 1.18.2
2024-04-25 08:16:31 Using rb-fsevent 0.11.2
2024-04-25 08:16:31 Using rb-inotify 0.10.1
2024-04-25 08:16:31 Using sass-listen 4.0.0
2024-04-25 08:16:31 Using sass 3.7.4
2024-04-25 08:16:31 Using jekyll-sass-converter 1.5.2
2024-04-25 08:16:31 Using listen 3.9.0
2024-04-25 08:16:31 Using jekyll-watch 2.2.1
2024-04-25 08:16:31 Using rexml 3.2.6
2024-04-25 08:16:31 Using kramdown 2.4.0
2024-04-25 08:16:31 Using liquid 4.0.4
2024-04-25 08:16:31 Using mercenary 0.3.6
2024-04-25 08:16:31 Using pathutil 0.16.2
2024-04-25 08:16:31 Using rouge 3.30.0
2024-04-25 08:16:31 Using safe_yaml 1.0.5
2024-04-25 08:16:31 Using jekyll 3.9.5
2024-04-25 08:16:31 Using jekyll-avatar 0.8.0
2024-04-25 08:16:31 Using jekyll-coffeescript 1.2.2
2024-04-25 08:16:31 Using jekyll-commonmark 1.4.0
2024-04-25 08:16:31 Using jekyll-commonmark-ghpages 0.4.0
2024-04-25 08:16:31 Using jekyll-default-layout 0.1.5
2024-04-25 08:16:31 Using jekyll-feed 0.17.0
2024-04-25 08:16:31 Using jekyll-gist 1.5.0
2024-04-25 08:16:31 Using jekyll-github-metadata 2.16.1
2024-04-25 08:16:31 Using jekyll-include-cache 0.2.1
2024-04-25 08:16:31 Fetching mini_portile2 2.8.5
2024-04-25 08:16:31 Installing mini_portile2 2.8.5
2024-04-25 08:16:31 Using racc 1.7.3
2024-04-25 08:16:31 Fetching nokogiri 1.13.10 (x86_64-linux)
2024-04-25 08:16:33 Installing nokogiri 1.13.10 (x86_64-linux)
2024-04-25 08:16:34 Using html-pipeline 2.14.3
2024-04-25 08:16:34 Using jekyll-mentions 1.6.0
2024-04-25 08:16:34 Using jekyll-optional-front-matter 0.3.2
2024-04-25 08:16:34 Using jekyll-paginate 1.1.0
2024-04-25 08:16:34 Using jekyll-readme-index 0.3.0
2024-04-25 08:16:34 Using jekyll-redirect-from 0.16.0
2024-04-25 08:16:34 Using jekyll-relative-links 0.6.1
2024-04-25 08:16:34 Using rubyzip 2.3.2
2024-04-25 08:16:34 Using jekyll-remote-theme 0.4.3
2024-04-25 08:16:34 Using jekyll-seo-tag 2.8.0
2024-04-25 08:16:34 Using jekyll-sitemap 1.4.0
2024-04-25 08:16:34 Using jekyll-swiss 1.0.0
2024-04-25 08:16:34 Using jekyll-theme-architect 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-cayman 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-dinky 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-hacker 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-leap-day 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-merlot 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-midnight 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-minimal 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-modernist 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-primer 0.6.0
2024-04-25 08:16:34 Using jekyll-theme-slate 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-tactile 0.2.0
2024-04-25 08:16:34 Using jekyll-theme-time-machine 0.2.0
2024-04-25 08:16:34 Using jekyll-titles-from-headings 0.5.3
2024-04-25 08:16:34 Using jemoji 0.13.0
2024-04-25 08:16:34 Using kramdown-parser-gfm 1.1.0
2024-04-25 08:16:34 Using minima 2.5.1
2024-04-25 08:16:34 Using unicode-display_width 1.8.0
2024-04-25 08:16:34 Using terminal-table 1.8.0
2024-04-25 08:16:34 Using github-pages 231
2024-04-25 08:16:34 Using webrick 1.8.1
2024-04-25 08:16:34 Bundle complete! 3 Gemfile dependencies, 93 gems now installed.
2024-04-25 08:16:34 Use `bundle info [gemname]` to see where a bundled gem is installed.
2024-04-25 08:16:35 Cleaning all the gems on your system is dangerous! If you're sure you want to
2024-04-25 08:16:35 remove every system gem not in this bundle, run `bundle clean --force`.
2024-04-25 08:16:35 ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
2024-04-25 08:16:38 Configuration file: /usr/src/app/_config.yml
2024-04-25 08:16:39 Source: /usr/src/app
2024-04-25 08:16:39 Destination: /usr/src/app/_site
2024-04-25 08:16:39 Incremental build: disabled. Enable with --incremental
2024-04-25 08:16:39 Generating...
2024-04-25 08:16:59 done in 19.929 seconds.
2024-04-25 08:16:59 Auto-regeneration: enabled for '/usr/src/app'
2024-04-25 08:17:00 LiveReload address: http://0.0.0.0:35729
2024-04-25 08:17:00 Server address: http://0.0.0.0:4000
2024-04-25 08:17:00 Server running... press ctrl-c to stop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking a later docker imag version is necessary for ruby support after I snapped to the gh-pages deps in #1512
It works, maybe nuke your Gemfile.lock before running
Co-authored-by: David Lakin <github@themoderndev.com>
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im seeing pretty rough perf in the docker container, 90 seconds to rebuild
vs about 8 when running livereload outside the container
But it's working and is a good step forward for getting the project up and running
Main Changes
I had some issues to run the project locally, so I explored a way to run the project using Docker (including live reloading). Also I added an additional step in the CI to ensure that the Docker support is tested on every change.
Acknowledgments
I used this article by @monkiki as a reference for the Makefile configuration.
Changelog