Search code examples
dockerbitbucketbitbucket-pipelines

Bitbucket Pipeline "docker: command not found"


After following the article "Run Docker commands in Bitbucket Pipelines" I came up with this sample pipeline I'm trying to build for a Python repository.

image: python:3.10-slim

pipelines:
  branches:
   '**':
     - step:
         name: Test Docker Commands
         runs-on:
            - 'self.hosted'
            - 'docker'
            - 'linux'
         services:
            - docker
         script:
            - docker version

definitions:
  services:
     docker:
        memory: 2048

But I get the following error:

bash: docker: command not found

I also tried to add the export DOCKER_BUILDKIT=1 but there were no improvements.

Is there something I'm missing or misunderstood?


Solution

  • I found the solution to my problem. There were two main issues:

    • Runner System: The runner needed to be based on 'Linux Docker'.
    • Version Update: My runner was left at version 1.384. Updating it to the latest version (2.4.0) resolved the issue, and the docker commands became available.

    Thank you, @N1ngu, for pointing me in the right direction!