Hi Adrian,
the npm command is actually installed inside the image, the collection
is just not enabled in your case.
With `RUN bash -c "npm --version"` instead:
Sending build context to Docker daemon 478.7 kB
Step 1/3 : FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7
Trying to pull repository
registry.access.redhat.com/rhscl/nodejs-8-rhel7 ...
sha256:66ae3f2d4cd53e1fa232018079afe9ccb27f451d932b3a57d158609d0ecfbaa2:
Pulling from registry.access.redhat.com/rhscl/nodejs-8-rhel7
9a32f102e677: Already exists
b8aa42cec17a: Already exists
84fbac7bf4f5: Pull complete
e347f5c3e6de: Pull complete
d7205639c454: Pull complete
Digest:
sha256:66ae3f2d4cd53e1fa232018079afe9ccb27f451d932b3a57d158609d0ecfbaa2
Status: Downloaded newer image for
registry.access.redhat.com/rhscl/nodejs-8-rhel7:latest
---> 505e241c8113
Step 2/3 : EXPOSE 8080
---> Running in 83a826e5a103
---> 9f3d2ed35228
Removing intermediate container 83a826e5a103
Step 3/3 : RUN bash -c "npm --version"
---> Running in b97f25fa5fba
5.3.0
---> 2c1e9751d2d5
Removing intermediate container b97f25fa5fba
Successfully built 2c1e9751d2d5
Hope this helps,
Petr
On 02/15/2018 11:32 AM, Höhn Adrian wrote:
Hi
I try to use your s2i image nodejs-8-rhel7 with the following
Dockerfile config on OpenShift.
FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7
<http://registry.access.redhat.com/rhscl/nodejs-8-rhel7>
EXPOSE 8080
RUN npm --version
But when I try to build it on the Openshift platform I get the
following error: *npm: command not found*
Can you explain me why npm cannot be found on this image and what I
have to do to make it work? I expect that npm is part of a node image,
not?
Thanks for your support,
Adrian
Openshift Logfile:
Pulling image registry.access.redhat.com/rhscl/nodejs-8-rhel7 ...
Pulled 2/5 layers, 41% complete
Pulled 3/5 layers, 63% complete
Pulled 4/5 layers, 84% complete
Pulled 5/5 layers, 100% complete
Extracting
Step 1 : FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7
Trying to pull repository
registry.access.redhat.com/rhscl/nodejs-8-rhel7 ...
sha256:66ae3f2d4cd53e1fa232018079afe9ccb27f451d932b3a57d158609d0ecfbaa2:
Pulling from registry.access.redhat.com/rhscl/nodejs-8-rhel7
9a32f102e677: Already exists
b8aa42cec17a: Already exists
84fbac7bf4f5: Already exists
e347f5c3e6de: Already exists
d7205639c454: Already exists
Digest:
sha256:66ae3f2d4cd53e1fa232018079afe9ccb27f451d932b3a57d158609d0ecfbaa2
Status: Image is up to date for
registry.access.redhat.com/rhscl/nodejs-8-rhel7:latest
---> 505e241c8113
Step 2 : ENV ***
---> Running in 8bd5877d7e3b
---> 18f0b2af283a
Removing intermediate container 8bd5877d7e3b
Step 3 : EXPOSE 8080
---> Running in 6ec866f0d02c
---> 479b9e490fab
Removing intermediate container 6ec866f0d02c
Step 4 : RUN npm --version
---> Running in a00f61761e3a
/bin/sh: npm: command not found
error: build error: The command '/bin/sh -c npm --version' returned a
non-zero code: 127
_______________________________________________
SCLorg mailing list
SCLorg@redhat.com
https://www.redhat.com/mailman/listinfo/sclorg
_______________________________________________
SCLorg mailing list
SCLorg@redhat.com
https://www.redhat.com/mailman/listinfo/sclorg