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

Selfhosted runner, cannot use docker commands.

Kristian Overgaard November 9, 2022

I've run into a problem where a selfhosted runner, no longer works with docker commands. 

 

I'm using a Linux runner, and adds docker with the services: docker in the bitbucket pipelines yml. 

 

It worked back in version 1.364

Runner matching labels:
- linux
- self.hosted
Runner name: Stat Migration Runner
Runner labels: statapi, self.hosted, linux
Runner version:
current: 1.364
latest: 1.364
where it uses a build and docker image:
Images used:
build: atlassian/default-image@sha256:5ce8190e86ba11a8e935735ad2059524b020a0a6f652ff4df614353329af0c07
On the newest version 1.371 it doesn't use the docker image:

Runner matching labels:
- linux
- self.hosted
Runner name: Stat Migration Runner
Runner labels: statapi, self.hosted, linux
Runner version:
current: 1.371
latest: 1.371


Images used:
build: atlassian/default-image@sha256:5ce8190e86ba11a8e935735ad2059524b020a0a6f652ff4df614353329af0c07
extract from pipelines yml: (apologies for formatting, not sure how to add code blocks or no-format blocks. )
pipelines:
branches:
'master':
  - step:
name: 'Build and push'
script:
  - docker version
services:
  - docker
  - step:
name: 'Database Migration'
runs-on:
  - self.hosted
  - linux
script:
  - docker version
services:
  - docker

2 answers

1 accepted

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

Hi @Kristian Overgaard,

Welcome to the community.

While using the latest version of Linux Docker runners, would it be possible for you to try to use the image docker:dind as your Docker image as a service?

You can add the "definitions:" configuration below to your YAML file above the "pipelines:" config.

definitions:
   services:
      docker:
         image: docker:dind

pipelines:
  branches:
    'master':
          - step:
..........................................

Once done, try to run builds again.
Let me know how it goes.

Regards,
Mark C

Michael Herzog November 14, 2022

@Mark C I took over from Kristian and have changed the config as per your suggestion. I also recreated the runner and now it runs as expected. 

Thanks.

Like Mark C likes this
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 14, 2022

Hi @Michael Herzog

Great. Glad to know it works.

Do let me know if you have further questions that I can help with and feel free to mark this question as answered as well.

Regards,
Mark C

Like Kristian Overgaard likes this
0 votes
Ramesh April 16, 2023

Hi @Mark C 

I am also facing the same problem. But your above solution did not fix the problem for me. I am getting error "The Docker feature is not supported on this self-hosted runner's platform.". The error screenshot is attached below.

Screenshot from 2023-04-16 21-47-20-1.png

 

 

Below is my bitbucket-pipelines.yml

definitions:
services:
docker:
image: docker:dind
pipelines:
default:
- step:
name: 'Step1'
runs-on:
- self.hosted
- linux.shell
script:
- echo "1.This step of pipeline will run on a self hosted runner.";
- docker version
- echo "2.This step of dtf-chain-handler pipeline, has successfully executed.";
services:
- docker

I am facing big challenges of running docker commands from my self-hosted, linux-shell runner. I have been looking for solution for this problem for several days, but I could not get any solution online even not in Atlassian docs. Please provide the solution for this as soon as possible.
Thanks,
Ramesh

Suggest an answer

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

Atlassian Community Events