I don’t have any more ideas since I haven’t played with containers much :(

Feels like the NPM command is not being ran on the container. Does it work
if you remove the NPM stuff?

On Mon, Sep 17, 2018 at 03:57 Blau Gil <gil.b...@bitmaintech.com> wrote:

> Hi Jan,
>
> Thank you for assisting.
> Yes the container runs on its own, only when I try to run the container
> image with Jenkins it fails.
>
> Any idea what I can do to resolve this?
>
> Thanks,
> --Gil.
>
> On Thu, 23 Aug 2018 at 04:04, Jan Monterrubio <janmonterru...@gmail.com>
> wrote:
>
>> Does the container work on its own?
>>
>> Looks like you have this part in the container:
>>
>> "RUN apk add --no-cache --virtual .gyp \
>> python \
>> make \
>> g++ \
>> git \
>> && npm install --quit && npm cache clean --force \
>> && apk del .gyp"
>>
>> Which runs npm install
>>
>> On Wed, Aug 22, 2018 at 6:08 AM gil <gil.b...@bitmaintech.com> wrote:
>>
>>> Anyone?
>>>
>>> On Sunday, 12 August 2018 11:28:54 UTC+3, gil wrote:
>>>>
>>>> Trying to tun a podTemaplate with the following containerTemplate, we
>>>> get the following error:
>>>>
>>>> npm ERR! path /home/jenkins/package.json
>>>> npm ERR! code ENOENT
>>>> npm ERR! errno -2
>>>> npm ERR! syscall open
>>>> npm ERR! enoent ENOENT: no such file or directory, open
>>>> '/home/jenkins/package.json'
>>>> npm ERR! enoent This is related to npm not being able to find a file.
>>>> npm ERR! enoent
>>>>
>>>> npm ERR! A complete log of this run can be found in:
>>>> npm ERR! /home/jenkins/.npm/_logs/2018-07-18T10_27_32_822Z-debug.log
>>>>
>>>>
>>>>
>>>> Configurations:
>>>>
>>>> Jenkinsfile PodTemplate:
>>>>
>>>>
>>>> deftestpod="testpod-${UUID.randomUUID().toString()}"
>>>> podTemplate(label: testpod, containers: [
>>>> containerTemplate(
>>>> name: 'myContainer',
>>>> image: 'gcr.io/xxx/xxxs/zzz:latest',
>>>> alwaysPullImage: true
>>>> )],
>>>> volumes: [
>>>> hostPathVolume(hostPath: '/var/run/docker.sock', mountPath:
>>>> '/var/run/docker.sock')
>>>> ])
>>>>     {
>>>> try{
>>>> node(testpod) {
>>>> stage ("checkout") {
>>>> container('myContainer')
>>>> { checkout scm }
>>>>
>>>> }
>>>> ...
>>>>
>>>> zzz dockerfile:
>>>>
>>>> FROM node:8.9.4-alpine
>>>> RUN mkdir -p /usr/src/app
>>>>
>>>> WORKDIR /usr/src/app
>>>>
>>>> COPY package.json /usr/src/app/
>>>> ARG NODE_ENV
>>>> ENV NODE_ENV $NODE_ENV
>>>>
>>>>    1. Add packages needed to build native dependencies
>>>>    RUN apk add --no-cache --virtual .gyp \
>>>>    python \
>>>>    make \
>>>>    g++ \
>>>>    git \
>>>>    && npm install --quit && npm cache clean --force \
>>>>    && apk del .gyp
>>>>
>>>> RUN apk add --no-cache vim curl
>>>> COPY . .
>>>>
>>>> EXPOSE 8888
>>>> CMD [ "npm", "start"]
>>>>
>>>>
>>>> *****
>>>>
>>>> /home/jenkins is mounted as a volume
>>>>
>>>> 1. Why this mounted volume effects the container?
>>>>
>>>> 2. Does the plugin do anything besides "docker run <docker id>"? I am
>>>> asking this because I don't understand why it is running "nmp install"...
>>>>
>>>> 3. Can you please suggest how can this be fixed?
>>>>
>>>>
>>>> FYI -
>>>>
>>>> If I add a working directory to the containerTemplate I get the same
>>>> error with the working directory path:
>>>>
>>>> working directory configuration:
>>>> workingDir: '/usr/src/app',
>>>>
>>>>
>>>> Err msg:
>>>>
>>>> kubectl logs -f -c workers jenkins-slave-4tfz2-3nw6d -n jenkins
>>>> npm ERR! path /usr/src/app/package.json
>>>> npm ERR! code ENOENT
>>>> npm ERR! errno -2
>>>> npm ERR! syscall open
>>>> npm ERR! enoent ENOENT: no such file or directory, open
>>>> '/usr/src/app/package.json'
>>>> npm ERR! enoent This is related to npm not being able to find a file.
>>>> npm ERR! enoent
>>>>
>>>>
>>>>
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/eaaf1ea1-698a-4712-9776-95a3ecea46d0%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/eaaf1ea1-698a-4712-9776-95a3ecea46d0%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>>
> You received this message because you are subscribed to a topic in the
>> Google Groups "Jenkins Users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/jenkinsci-users/mauO_28wUOI/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CADgiF9KsvXCcFr2vfuE%3DUVR5EcNBrivVmQnUc-rK%3DJ8upviRRg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/CADgiF9KsvXCcFr2vfuE%3DUVR5EcNBrivVmQnUc-rK%3DJ8upviRRg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAAwzALub0_bitNaXdSWF6BaO7t6tGycRTwfvDYbFGy27g3Praw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAAwzALub0_bitNaXdSWF6BaO7t6tGycRTwfvDYbFGy27g3Praw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CADgiF9JTszf1JU%2BhPpab81XnFkQ%2B%3D_%3D8dxA5bLyHdz-YQ0y0GQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to