Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to pass multiple command to the container while running a docker in bamboo

chatli vlogs July 4, 2023

example to pass multiple commands to the runner docker as an interactive session

1 answer

1 accepted

2 votes
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 4, 2023

Hello @chatli vlogs,

Welcome to Atlassian Community!

You can use a shell wrapper such as the one below to achieve multiple commands. Your container needs to have a valid shell that supports it. For example, with bash:

/bin/bash -c "command1 && command2"

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

chatli vlogs July 5, 2023

Screenshot 2023-07-05 at 12.51.46 PM.png

 

If you see my screenshot i can able to pass only one command how to add multiple commands in this how can i add a script to this by passing commands

Like Eduardo Alvarenga likes this
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2023

Hey @chatli vlogs

Instead of:

ls -ltr

Replace it with:

bash -c "ls -ltr && command2"

And you should be good.

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Like Steffen Opel _Utoolity_ likes this
chatli vlogs July 5, 2023

Screenshot 2023-07-05 at 1.53.50 PM.png

Thankyou it is working for me and one more query, iam having inline script that i need to run in docker container, once docker runner configure and executed i need to run this script please suggest on this as well

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events