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?
2
Answers
I found the solution to my problem. There were two main issues:
Thank you, @N1ngu, for pointing me in the right direction!
There is no docker command inside python image. You have to install it inside the image, or use a docker:cli image.
See
dind
– "docker-in-docker" documentation, see docker.hub docker images and tags. See default bitbucket pipelines image documentation, see https://hub.docker.com/r/atlassian/default-image/ .