Cat Command without Object In Container Template

11/21/2018

i'm interested with jenkins dynamic slave in kubernetes with this repo

https://github.com/fabric8io/kubernetes-plugin

I know cat use to be followed by object, but in this template it just cat without object behind.

So what's the function of the "cat" command below?

def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, containers: [
    containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, **command: 'cat'**),
    containerTemplate(name: 'golang', image: 'golang:1.8.0', ttyEnabled: true, **command: 'cat'**)
  ]) {

______Found the answer by myself________

For you all that misunderstand and you all that downvote my question

So, the cat on that container template, is to keep the container running forever, so the container won't be recreated again when the container has been created

-- Fauzan
jenkins
kubernetes

1 Answer

11/21/2018

That's the command that's executed. if you don't know what the cat command does, here's some info: http://www.linfo.org/cat.html (it's most commonly used to display files).

In the above context it's used to prove the concept of running commands in another container by displaying the piped stream.

-- Markus Dresch
Source: StackOverflow