Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Self hosted runner on bitbucket pipeline is unable to run docker commands

shreya gaikwad August 18, 2023

Tried all the possible ways provided by bitbucket:

https://confluence.atlassian.com/bbkb/cannot-connect-to-the-docker-daemon-error-while-running-docker-commands-using-bitbucket-cloud-pipelines-linux-shell-runners-1189796514.html

still unable to run docker commands

 

showing 

bash: docker: command not found

1 answer

1 accepted

0 votes
Answer accepted
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2023

G'day @shreya gaikwad and welcome to the community.

May I know what type of runner you are using and would it be possible to share your YML? I wish to review your YML config to further understand why you are getting the error. 

Please remove any credentials etc before sharing the YML.

Regards,
Syahrul

shreya gaikwad August 23, 2023
Linux.shell I am using 
Tried linux docker also 
just simple yml I am trying to execute for the docker commands even docker info command is not getting execute.
pipelines:
default:
- step:
runs-on:
- self.hosted
- linux
script:
- docker run alpine
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2023

Hi @shreya gaikwad 

Thanks for the update. It looks like you are using docker in steps, but you did not specify docker services in the YAML; hence your steps were failing:

pipelines:
  default:
    - step:
        runs-on: 
          - 'self.hosted'
          - 'my.custom.label'
        services:
          - docker
        script:
          - docker run alpine 

 For more information, please check our documentation at:

https://support.atlassian.com/bitbucket-cloud/docs/databases-and-service-containers/

Regards,
Syahrul

shreya gaikwad August 24, 2023

Hi Syahrul,

I have tried that also but still I was facing different error.

Once again I tried as you told ,I have copied the yml which you shared and put my runner name.

 

pipelines:
default:
- step:
runs-on:
- 'self.hosted'
- 'linux.shell'
services:
- docker
script:
- docker run alpine

Still getting the error as below:

The Docker feature is not supported on this self-hosted runner's platform.error.png

Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2023

Hi @shreya gaikwad 

Looks like you are using a Linux shell that doesn't support a Service container. Could you switch your runner to Linux docker instead and let me know if that works?

Regards,
Syahrul

shreya gaikwad August 25, 2023

Hi Syahrul,

yes now it is working.

Thank you Syahrul.

Suggest an answer

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

Atlassian Community Events