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-slim
pipelines:
branches:
'**':
- step:
name: Test Docker Commands
runs-on:
- 'self.hosted'
- 'docker'
- 'linux'
services:
- docker
script:
- export DOCKER_BUILDKIT=1
- docker version
definitions:
services:
docker:
memory: 2048
But I get the following error:
bash: docker: command not found
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.