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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket Pipeline breaks with long command

Edited

I have this bug in my pipeline that started yesterday when I added a second environment variable that changes the `docker build` command.

this command does not work (real values were replaced)

`docker build -f mydir/Dockerfile -t my/corp/tag --build-arg VAR1=$VAR1 --build-arg VAR2=$VAR2 . `

With error `"docker build" requires exactly 1 argument.`

The build args list is dynamically generated. If I write the command as is and execute, the same error happens. It took me a while to find out that this works:

`docker build -f mydir/Dockerfile -t my/corp/tag --build-arg VAR1=$VAR1 . `

At first I thought that the problem was the amount of arguments and that a special character was breaking the interpreter. 

Then it came to my mind that the LENGTH of the command was too long. With the two arguments, 278 characters.and with only one, it's 189. It breaks somewhere between 190 and 278 characters long. Plus I replaced the original values with multiple small key/values and it seems to work as well.

Is that an known issue? Is there a workaround? Could someone help me please

1 answer

I've just hit something similar, but in my case, there were spaces in variable.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,719 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you