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

Bitbucket Pipeline "docker: command not found"

Luigi Loria
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 25, 2024

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

1 answer

1 vote
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 25, 2024

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)

 

 

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events