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

Unable to build/push Windows container via Windows Runner

Casey Wise November 11, 2022

Brand new to Windows runners, thanks for reading. 

Here's where I am

  • I was able to get the Windows Runner operating as expected on my Windows machine.
  • When I review workspace runners in the Bitbucket Settings > Runners I see a green ONLINE 
  • Confident Bitbucket and my Windows runner are communicating as, in pipeline execution logging, I observe expected output from PowerShell commands like docker --versionls and Get-Content (on my Dockerfile)

What am I trying to do?  

  1. Build docker image
  2. Upload to image repo (AWS ECR)

What's the problem?

  • I'm stuck on #1.  In my pipeline yaml, I navigate in to the Dockerfile's directory and build an image against my Dockerfile (docker build .)
    - step: &winrun
    runs-on:
    - self.hosted
    - windows
    script:
    - cd src
    - docker build -t example .
  • I see the following error
    error during connect: Post "http://localhost:2375/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&target=&ulimits=null&version=1": dial tcp [::1]:2375: connectex: No connection could be made because the target machine actively refused it.

What have I done to try and fix this?

  • Questioning "Is there a problem with this Dockerfile?" I head over to my Windows runner, drop my Dockerfile in to the filesystem, docker build . I see what I expect and the Docker engine goes to work pulling.  Dockerfile is fine.
  • I've looked around here in the community forum, no luck.
  • Googling is returning all sorts of content around No connection could be made because the target machine actively refused it. which is not relevant to my issue

 

1 answer

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 15, 2022

Hi @Casey Wise,

Thank you for reaching out to the community.

I checked this internally with our Pipelines team and this appears to be an issue where Pipelines is automatically setting DOCKER_HOST with the default host.

For that, would it be possible for you to empty it and try to run Docker commands again?
To empty the variable on Windows PowerShell, you can use the command below.

    script:
        - $Env:DOCKER_HOST = ""
        - cd src
        - docker build -t example .

Hope it helps and do let me know how it goes.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events