I've seen it reported before.
Check your pod logs, events and exit codes

On Thu, Aug 24, 2017 at 6:35 PM, Pedro Januário <[email protected]>
wrote:

> Hi,
>
> I am using Jenkins Pipeline with Kubernetes Plugin and doing something
> really simple just to build a container and run the container to execute
> the tests on it.
>
> While doing it I got a error that shows exit -2 without another
> information, currently I am just doing a echo.
>
> *Example (just part of it):*
>
> def containersForUnitTest = [
>   containerTemplate(name: 'mongotest',
>                   image: 'mongo:3.2.4',
>                   ttyEnabled: true, command: 'mongod --smallfiles',
>                   resourceLimitCpu: '150m',
>                   resourceRequestCpu: '100m',
>                   resourceRequestMemory: '512Mi',
>                   resourceLimitMemory: '512Mi',
>                   alwaysPullImage: false),
>   containerTemplate(name: 'microservice',
>                   image: "..myimage...",
>                   ttyEnabled: true, command: 'cat',
>                   resourceLimitCpu: '150m',
>                   resourceRequestCpu: '100m',
>                   resourceRequestMemory: '512Mi',
>                   resourceLimitMemory: '512Mi')
> ]
>
> podTemplate(name: "test", inheritFrom: 'jnlp', label: test", containers:
> containersForUnitTest) {
>   node("some") {
>     stage('Test') {
>       try {
>         container('microservice') {
>           sh """
>            echo "this is my echo thing"
>           """
>         }
>       }
>       catch (Exception e) {
>         echo "microservice error: ${e}"
>         throw e
>       }
>     }
>   }
> }
>
> If I add the following line to my dockerfile it will run successfully,
> this seems a awkward behaviour that seems to be related with permissions on
> the container execution. Don't see any other way to workaround this but it
> seems undesired.
>
> RUN chown node:node $APP_DIR \
>   && echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >>
> /etc/apk/repositories \
>   && apk --no-cache add shadow && usermod -u 10000 node
>
> Any clue? Is there anything that can cause this?
>
> --
> 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 [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/b921176c-33ca-48c2-a06e-a673aa6f6e72%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/b921176c-33ca-48c2-a06e-a673aa6f6e72%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 the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6MuQuzz7N4FSdrhvCEXjoOx5C%3DU3s57%2BmdCM40HNbonag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to