releases icon indicating copy to clipboard operation
releases copied to clipboard

Add Dockerized build environment & scripts

Open ryanprior opened this issue 4 years ago • 9 comments

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

ryanprior avatar Apr 05 '20 20:04 ryanprior

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

jeremypw avatar Apr 30 '21 11:04 jeremypw

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

RMcNeely avatar Oct 08 '21 13:10 RMcNeely

That said it works well! :tada:

RMcNeely avatar Oct 08 '21 13:10 RMcNeely

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

ryanprior avatar Oct 08 '21 19:10 ryanprior

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

RMcNeely avatar Oct 08 '21 19:10 RMcNeely

@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/?

ryanprior avatar Oct 09 '21 16:10 ryanprior

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.

RMcNeely avatar Oct 09 '21 16:10 RMcNeely

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.

ryanprior avatar Oct 09 '21 16:10 ryanprior

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.

RMcNeely avatar Oct 09 '21 17:10 RMcNeely