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

Unable to run build, mkdir permission denied #12

Closed
benc-uk opened this issue Oct 2, 2019 · 4 comments
Closed

Unable to run build, mkdir permission denied #12

benc-uk opened this issue Oct 2, 2019 · 4 comments

Comments

@benc-uk
Copy link
Contributor

benc-uk commented Oct 2, 2019

Running make build-run results in an error on line 11 of the Dockerfile (where jekyll build is run), adding --trace gives more details, which is a permission error on the mkdir step

This is using Docker running inside WSL2

docker build -t azch/aks-site:latest -f Dockerfile .
Sending build context to Docker daemon  49.91MB
Step 1/8 : FROM jekyll/builder AS build
 ---> 40cf7a7e8f7e
Step 2/8 : WORKDIR /src/app
 ---> Using cache
 ---> 67ac0a23d069
Step 3/8 : COPY . .
 ---> Using cache
 ---> f920d20498cb
Step 4/8 : RUN mkdir _site &&     jekyll build --future --trace
 ---> Running in 4a8b5106a410
ruby 2.6.4p104 (2019-08-28 revision 67798) [x86_64-linux-musl]
Configuration file: /src/app/_config.yml
/usr/local/lib/ruby/2.6.0/fileutils.rb:239:in `mkdir': Permission denied @ dir_s_mkdir - /src/app/.jekyll-cache (Errno::EACCES)
        from /usr/local/lib/ruby/2.6.0/fileutils.rb:239:in `fu_mkdir'
        from /usr/local/lib/ruby/2.6.0/fileutils.rb:217:in `block (2 levels) in mkdir_p'
        from /usr/local/lib/ruby/2.6.0/fileutils.rb:215:in `reverse_each'
        from /usr/local/lib/ruby/2.6.0/fileutils.rb:215:in `block in mkdir_p'
        from /usr/local/lib/ruby/2.6.0/fileutils.rb:200:in `each'
        from /usr/local/lib/ruby/2.6.0/fileutils.rb:200:in `mkdir_p'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/cache.rb:184:in `dump'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/cache.rb:101:in `[]='
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/cache.rb:45:in `clear_if_config_changed'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/site.rb:113:in `reset'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/site.rb:33:in `initialize'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:30:in `new'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:30:in `process'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
        from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
        from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
        from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
        from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
        from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
        from /usr/gem/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        from /usr/gem/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
        from /usr/gem/bin/jekyll:23:in `load'
        from /usr/gem/bin/jekyll:23:in `<main>'
The command '/bin/sh -c mkdir _site &&     jekyll build --future --trace' returned a non-zero code: 1
Makefile:17: recipe for target 'build-run' failed
make: *** [build-run] Error 1
@benc-uk
Copy link
Contributor Author

benc-uk commented Oct 2, 2019

As per this GH issue jekyll/jekyll#7591 (comment)
Fixed by adding an empty .jekyll-cache directory as described above

RUN mkdir _site && mkdir .jekyll-cache && \
    jekyll build --future

@sabbour
Copy link
Member

sabbour commented Oct 2, 2019

Do you mind submitting a PR for this? :)

@benc-uk
Copy link
Contributor Author

benc-uk commented Oct 2, 2019

Will do!
I've got an PR incoming with this, but also a bunch of things we've discovered trying to run through without clicking "toggle solution"

@sabbour
Copy link
Member

sabbour commented Oct 3, 2019

Fixed.

@sabbour sabbour closed this as completed Oct 3, 2019
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

2 participants