Building an image e.g. for jsReport 2.7 using Kaniko leads to an issue but was working for 2.6.1



  • Trying to build in a Gitlab Pipeline using Kaniko it leads to the following issue since jsReport 2.7

    npm ERR! code EACCES
    npm ERR! syscall mkdir
    npm ERR! path /.npm
    npm ERR! errno -13
    npm ERR! 
    npm ERR! Your cache folder contains root-owned files, due to a bug in
    npm ERR! previous versions of npm which has since been addressed.
    npm ERR! 
    npm ERR! To permanently fix this problem, please run:
    npm ERR!   sudo chown -R 100:101 "/.npm"
    npm ERR! code EACCES
    npm ERR! syscall mkdir
    npm ERR! path /.npm
    npm ERR! errno -13
    npm ERR! 
    npm ERR! Your cache folder contains root-owned files, due to a bug in
    npm ERR! previous versions of npm which has since been addressed.
    npm ERR! 
    npm ERR! To permanently fix this problem, please run:
    npm ERR!   sudo chown -R 100:101 "/.npm"
    

    I am not super sure if this is an jsReport issue but using the jsReport Docker versions it starts to not work since jsReport 2.7 with 2.6.1 there is no issue with Kaniko



  • Please elaborate more on how you build the image.



  • Hi @jan_blaha ,

    I tried to find a way to solve or overcome my issue and maybe this is interesting to share with others

    FROM jsreport/jsreport:2.11.0
    COPY jsreport.config.json jsreport.config.json
    RUN mkdir /app/.npm-global
    RUN npm install \
    jsreport-fs-store-aws-s3-persistence@1.4.1 \
    jsreport-fs-store-aws-sns-sync@1.2.1 \
    --cache /app/.npm-global
    RUN chmod +x /app/run.sh
    EXPOSE 5488
    CMD /app/run.sh
    

    Fist step is to create a npm cache folder where the jsReport user in the Docker file has acces to write

    RUN mkdir /app/.npm-global
    

    And in the second step to re-use this folder via npm

    RUN npm install \
    jsreport-fs-store-aws-s3-persistence@1.4.1 \
    jsreport-fs-store-aws-sns-sync@1.2.1 \
    --cache /app/.npm-global
    

    I hope this helps some using Kubernetes and creating the image via Kaniko


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.