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: name: python:3.10-slimpipelines: branches: '**': - step: name: Test Docker Commands runs-on: - 'self.hosted' - 'docker' - 'linux' services: - docker script: - export DOCKER_BUILDKIT=1 - docker versiondefinitions: services: docker: memory: 2048
But I get the following error:
<span><span>bash: docker: command not found<br></span></span>
Is there something I'm missing or misunderstood? Thank you in advance
Hi @Luigi Loria
The reason that you are seeing this error message is that docker is not included as part of the build image you are using (python:3.10-slim), I've tested this by running the image locally and attempting to perform docker commands and received the same error message:
> docker run -it --entrypoint=/bin/sh python:3.10-slim> docker info/bin/sh: 1: docker: not found
You will need to first install Docker as part of your script before attempting to run Docker commands (or use a different build image that includes Docker).
We have documentation that covers this in greater detail that you may find below:
Cheers!
- Ben (Bitbucket Cloud Support)
It looks like you're new here. Sign in or register to get started.