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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,780
Community Members
 
Community Events
184
Community Groups

Windows Hosted Runner: Docker calls to wrong host inside runner

Hello Community,

I also asked that question on SO but thought its more bitbucket specific so it would be good to ask this question here:

Ive got a windows runnter on my  win2019 server wit latest docker installed.

 

As suggested here: https://github.com/StefanScherer/dockerfiles-windows/tree/main/dockertls

 

I set up docker for tcp with activated TLS.

So far so good.

Outside the pipeline the script works just fine - also from my workstation im able to deploy the docker-compose project to my server.

 

However when it comes to run the exact same command inside the pipeline it ends up using the wrong host/port:

Command:  docker -H tcp://<ip>:2376 --tls --tlsverify --tlscacert=.\.dockercert\ca.pem --tlscert=.\.dockercert\cert.pem --tlskey=.\.dockercert\key.pem compose up -f <my yml files>...

 

Result:

error during connect: Get "http://localhost:2375/v1.24/containers/json?all=1&filters=...": dial tcp [::1]:2375: connectex: No connection could be made because the target machine actively refused it.

 

You can see somehow inside the pipeline docker tries to connect to http://localhost:2375 instead of "<ip>:2376". 

 

So I asume somethings happening inside the runner that changes the host or even removed the param, but I thought its just a java application that run on my powershell.

 

The cert files exist and as mentioned no problems when I run the command from any other mashine.

 

Any idea  how to fix it?

  

 

Best,

 

Malte

 

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 27, 2022

Hi @maldoe1990,


You mentioned

Outside the pipeline the script works just fine - also from my workstation im able to deploy the docker-compose project to my server.

Is the workstation the same as your Windows 2019 Server where the Bitbucket runner is running?

  • If not, can you copy the certificates on that server, then try running the Docker command you provided here on that server, and let me know if it works or if you get the same error?

  • Could you also please check if any Docker configuration files or any environment variables on this server have “localhost” configured on port 2375?

 

Kind regards,
Theodora

Hi @Theodora Boudale 

I tried with the same certificates on the server. It worked as intended. No Docker Host Env Vars so far.

It fails only when running the command inside windows runner

 

My config for docker deamon:

 

{
  "data-root": "D:\\Docker-Data",
  "tlscacert": "C:\\ProgramData\\docker\\certs.d\\ca.pem",
  "tlskey": "C:\\ProgramData\\docker\\certs.d\\server-key.pem",
  "tlscert": "C:\\ProgramData\\docker\\certs.d\\server-cert.pem",
  "hosts": [
    "tcp://0.0.0.0:2376",
    "npipe://"
  ],
  "tlsverify": true
}

 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 12, 2022

Hi Malte,

I discussed this issue with the development team, Docker hasn't been tested for Windows Runners yet and it is therefore not supported.

I created a feature request in our issue tracker to add support for Docker on Windows Runners: https://jira.atlassian.com/browse/BCLOUD-22187

I would suggest adding your vote to that feature request to express your interest.

Currently, we are setting the variable DOCKER_HOST to tcp://localhost:2375 by default which can lead to issues, I am unsure though why you see http://localhost:2375 in the output.

Can you try adding the following command in the script of your bitbucket-pipelines.yml file (before the docker command) and check if your build can run afterwards?

$env:DOCKER_HOST = ""

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events