Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-12230

Node app in ch06s04 has NPM cache problems

XMLWordPrintable

    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • en-US (English)
    • DO188 v4.14 Sprint 2, DO188 v4.14 Sprint 3

      Please fill in the following information:


      URL:  
      Reporter RHNID: rht-psolarvi
      Section Title: Guided Exercise: Remote Debugging Containers                                       

      Issue description

      Step 4.3 fails to start the container because it has the NPM cache directory problem.

       

      Steps to reproduce:

       

      Workaround:

      Tweak the Containerfile after step 1.1 to contain the following instructions:

       

      FROM registry.ocp4.example.com:8443/ubi8/nodejs-16:1

      ENV NPM_CACHE=/tmp/.npm

      EXPOSE 8080
      EXPOSE 9229

      USER root

      RUN npm config set cache "$NPM_CACHE" --location=global

      COPY --chown=default:root . .

      RUN npm install && chown -R 1001:0 "$NPM_CACHE" && chmod -R ugo+rwx "$NPM_CACHE"

      USER default

      CMD npm start{}

      Expected result:

            rht-psolarvi Pablo Solar
            rht-psolarvi Pablo Solar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: