keyurvr
(Keyurvr)
January 23, 2018, 7:16am
1
Hello
I have multiple containers in my private network.
I want to execute command like in running container without enter in it.
Like i want to some bash file in my main host and i want to execute in my running container same i also want to execute command in my running container.
Please suggest me
keyurvr
(Keyurvr)
January 23, 2018, 8:36am
3
Hey Thanks !!
It’s working but when I execute from jenkins it gives below error.
[SSH] executing…
the input device is not a TTY
[SSH] completed
[SSH] exit-status: 1
Build step ‘Execute shell script on remote host using ssh’ marked build as failure
Finished: FAILURE
think
(Think)
January 23, 2018, 10:58am
4
Jenkins does not execute jobs in a tty. So when you exec into your container, do not do “-t”
For jenkins and docker, this is probably the way to go:
keyurvr
(Keyurvr)
January 23, 2018, 11:36am
5
Yes I have tried without -t and it’s working.
Thanks for the support.
keyurvr
(Keyurvr)
January 23, 2018, 11:39am
6
You can also try with below mentioned command
docker exec -i container -id sh -c ‘cd /var/www/html/wordpress && git pull’
Above command execute pull in to container.
2 Likes