How can I set the proxy for bitbucket? Edited

 

Im trying to run Bitbucket in Docker at my company for production. My machine is behind a proxy, which blocks almost everything, for security reasons. You know that you can authentificate with a proxy-user to access the www. I passed the user in the Dockerimage and the container is acutually able to connect with the www. But the Bitbucket-application is NOT. Everytime I start the server this coming up:

com.atlassian.upm.pac.PacClientImpl Error when querying application info from MPAC: com.atlassian.marketplace.client.MpacException: org.apache.http.conn.ConnectTimeoutException: Connect to marketplace.atlassian.com:443 [marketplace.atlassian.com/52.2.89.223, marketplace.atlassian.com/34.239.16.84, marketplace.atlassian.com/34.205.61.250] failed: connect timed out

I tried to pass some JVM_OPTS via environmentvariables:

JVM_OPTS=" -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -Dhttp.proxyUser=-Dhttp.proxyPassword=-Dhttps.proxyUser=-Dhttps.proxyPassword="

but it didn't work.

1 answer

1 accepted

In the Bitbucket bin/ directory, there is a script called "

_start-webapp.sh" (note the leading underscore.) There is a variable "JVM_SUPPORT_RECOMMENDED_ARGS=" in that file that you can uncomment and add your switches to. That gets called during the startup process and will set the environment the way you need it.

I would recommend not changing anything else in that file, even though adjusting memory settings is tempting. Before touching anything else in there, I recommend reading over some of the Bitbucket scaling docs.

okay I found the file and uncomment the JVM_SUPPORT_RECOMMENDED_ARGS and added  my variable like above= JVM_SUPPORT_RECOMMENDED_ARGS="JVM_OPTS=" -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -Dhttp.proxyUser=-Dhttp.proxyPassword=-Dhttps.proxyUser=-Dhttps.proxyPassword="

 

everytime I start the docker container with the new .sh the Contaier stops and says: no such file or directory.. 

i tryed it with and without the ""..

I added the JVM_SUPPORT_RECOMMENDED_ARGS as a environemntvariable in my Dockerfile and it works fine now. Thank you for your help! Have a nice Weekend.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,940 views 1 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you