Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Pre-built Jekyll image #919

Closed
Chuxel opened this issue Jun 24, 2021 · 11 comments
Closed

Pre-built Jekyll image #919

Chuxel opened this issue Jun 24, 2021 · 11 comments
Assignees
Milestone

Comments

@Chuxel
Copy link
Member

Chuxel commented Jun 24, 2021

Jekyll is used heavily throughout GitHub and generally in static web sites. We can pre-build a version of this image for use. @2percentsilk and @parkr are discussing requirements.

@2percentsilk
Copy link
Member

Moving our convos here versus slack!
@parkr recommended the following initially:

To be consistent with GitHub Pages, it would be great to install the latest patch version of Ruby 2.7.x, and Jekyll 3.9.x
Dependencies (Jekyll, Ruby, etc) are shared here: https://pages.github.com/versions/
If you install Jekyll 3.9.x and the Gemfile requires 4.x, I think bundle install will ignore the systemwide Jekyll and install the repo-specific one. The only potential problem would be running jekyll build – will it pick the pre-installed one or the one in Gemfile? I'd want to test that...

We're now discussing if it makes sense to have an overarching general use Jekyll image as well as a more specific one geared to GitHub pages. My thought is that we want to have one image that ideally works for both so that we don't have to deal with the maintenance of two very similar images and definitions.

The lastest question from @parkr is "could we alias jekyll="bundle exec jekyll"? Then we can just run bundle install and it'll automatically use the bundled version"
Pardon my ignorance but would this let us just prebuild one image and have it work for general Jekyll development & Pages? I think our goal is to have images that don't require us to run any installations in the postCreateCommand since that's what takes the longest at the moment.

@parkr
Copy link
Contributor

parkr commented Jun 29, 2021

If you're worried about post-creation command speed, then the best bet is to install the github-pages gem (Jekyll 3.x) and then install Jekyll v4. The most common configurations for Jekyll sites are GitHub Pages and the latest Jekyll. If these are pre-installed on the system, then when postCreateCommand runs bundle install, it will be very fast.

@Chuxel Chuxel added this to the July 2021 milestone Jun 30, 2021
@Chuxel
Copy link
Member Author

Chuxel commented Jul 1, 2021

//cc: @cmendible as well since we'd be converting that definition into a pre-built one.

@parkr So:

FROM mcr.microsoft.com/vscode/devcontainers/ruby:2

# ...

RUN gem install bundler jekyll github-pages

...and have a pre-built image with all this in it. Then leave https://github.com/microsoft/vscode-dev-containers/blob/main/containers/jekyll/.devcontainer/post-create.sh largely as-is.

That accurate?

@Chuxel
Copy link
Member Author

Chuxel commented Jul 1, 2021

Put up a PR for review (#929). Let me know if it looks good.

@Chuxel
Copy link
Member Author

Chuxel commented Jul 12, 2021

@parkr Quick check-in: Any feedback here?

@Chuxel
Copy link
Member Author

Chuxel commented Jul 12, 2021

@parkr @2percentsilk Okay, development image is up. See what you think!

$ docker run -it --rm mcr.microsoft.com/vscode/devcontainers/jekyll:dev bash

@Chuxel
Copy link
Member Author

Chuxel commented Jul 12, 2021

I noticed this is using Ruby 3.0 because of #944 - I assume that's a problem? I'll work on a fix.

@Chuxel
Copy link
Member Author

Chuxel commented Jul 13, 2021

Ok - that's fixed as well.

@Chuxel
Copy link
Member Author

Chuxel commented Jul 16, 2021

This is being published with the v0.188.0 release. We can adjust from there.

@Chuxel Chuxel closed this as completed Jul 16, 2021
@kosperera
Copy link

kosperera commented Jul 24, 2021

I couldn't get this to work in the Apple M1. Previously worked awesomely in the Intel version.
I suspect it has something to do with the GitHub Pages Dependency versions, to be more specific, the Ruby version.

So switched to the base.Dockerfile in the ruby devcontainer with the 2.7.2 variant and it works.

Ref @kosalanuwan/jekyll-otto-theme/.devcontainer

@Chuxel
Copy link
Member Author

Chuxel commented Jul 26, 2021

@kosalanuwan We do not pre-build M1 images due to docker buildx failures. See #558

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants