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

improve caching and file permissions in make docker-serve #663

Open
rkm opened this issue May 29, 2020 · 3 comments
Open

improve caching and file permissions in make docker-serve #663

rkm opened this issue May 29, 2020 · 3 comments

Comments

@rkm
Copy link

rkm commented May 29, 2020

Hi! Is it worth revisiting #340 considering we now have a Docker lesson in incubation? Running the webpage locally can still be a bit of a pain! I'd like to contribute a Dockerfile / docker-compose script / documentation as part of my instructor training checkout process.

Edit: renamed issue after discussion below

@rkm
Copy link
Author

rkm commented Jun 2, 2020

Ah, I noticed that there is already a docker-serve make target for this!

It seems to run bundle install ... each time though, which can still take around 30s on successive calls even after .docker-vendor is populated (on my machine at least).

I've started working on a small improvement (gh-pages...rkm:gh-pages) which has the following advantages:

  • Successive calls to make docker-serve now only take ~5s
  • The image is only rebuilt when either JEKYLL_VERSION or the contents of Gemfile{,.lock} change
  • Avoids leaving a root-owned ~100MB directory in your working tree, as this is now stored in the image for re-use

Would you like me to make a PR for this?

@zkamvar
Copy link
Contributor

zkamvar commented Jun 2, 2020

Hi @rkm,

Thank you for this! In my experience with the Jekyll Docker container, it can be a bit finnicky with the host permissions.

I had previously set up a docker container for maintaining lessons at https://github.com/carpentries/lesson-docker/#docker-container-for-lesson-maintenance that will work for the workshop-template and has a couple of advantages:

  1. The versions of jekyll and ruby are pinned to github's specificatons
  2. There are no longer permissions issues with root-owned or user 1000 owned files (see here for details: Use carpentries/lesson-docker for docker-serve make rule styles#461)

Let me know what you think.

@rkm
Copy link
Author

rkm commented Jun 2, 2020

Thanks! I'll take a look at that although the docker image seems a little heavy at ~1.4GB.

I was only hoping to contribute a small usability fix to the current workflow in this repo, so apologies if this has raised more questions than it has answered! FWIW I believe I have fixed the permissions issues on my branch, so the only remaining issue I see is that of the jekyll/ruby version pinning (which is also not addressed in the current implementation).

@rkm rkm changed the title docker for local development improve caching and file permissions in make docker-serve Jun 2, 2020
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

No branches or pull requests

2 participants