Skip to content
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 Dockerized build environment & scripts #31

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ryanprior
Copy link

This PR contains

  • bin/build-container, a script which builds a Jekyll container using the local Gemfile
  • Dockerfile, which provides further build instructions to Docker
  • bin/serve, a script which serves the site using the built container
  • updates to the README explaining how to use the above

Motivation

By managing dependencies in containers, I avoid package version conflicts on my machine and I can present easily reproducible build and test instructions to others.

Dependencies

This PR adds an optional dependency on Docker.

How to test

Notice that there's a new sub-header under "Building" in the README. Check out this branch and follow the instructions there to build a container and serve the site. This should succeed with no errors.

I tested this with Docker version 19.03.8, build afacb8b7f0

@jeremypw
Copy link

@cassidyjames Is this of interest? I cannot do anything with this PR.

@RMcNeely
Copy link

RMcNeely commented Oct 8, 2021

There's an official docker image that I think would be better used if this is something we want to pursue.

@RMcNeely
Copy link

RMcNeely commented Oct 8, 2021

That said it works well! 🎉

@ryanprior
Copy link
Author

@RMcNeely which official docker image do you mean? Happy to update this PR if I can make it more useful.

@RMcNeely
Copy link

RMcNeely commented Oct 8, 2021

This is the one referenced in the Jekyll docs: https://hub.docker.com/u/jekyll
Personally I like the idea of Docker files for the web sites but I would really want it for the main website so I don't have to manage PHP. RVM is perfectly usable but Dockerfiles are nice

@ryanprior
Copy link
Author

@RMcNeely updated this PR to use your recommended base image & re-verified that it works with the provided script setup.

Happy to work on giving the main website the same treatment, should I open an issue in https://github.com/elementary/website/?

@RMcNeely
Copy link

RMcNeely commented Oct 9, 2021

Well elementary/website is the one thing that is not actually based on Jekyll so that one would be more involved (needs both NodeJS and PHP Composer) but I do think it's worth doing. The other Jekyll based sites should be similar to this.

@ryanprior
Copy link
Author

Is there a list of all the Jekyll-based websites? I can probably do those similar to this one, and work on a separate custom container image for the main website.

@RMcNeely
Copy link

RMcNeely commented Oct 9, 2021

Not that I'm aware of. Off the top of my head it's appcenter-web, releases, blog and technically edw but there may be others.

Copy link
Collaborator

@kgrubb kgrubb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some very minor conflicts in the README.md that need to be handled before merging, but aside from that, this looks good to me!

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

Successfully merging this pull request may close these issues.

4 participants