Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

docker command not found in Kubernetes runner

Hanz Yu
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!
July 20, 2023 edited

I was expecting able to call docker on workspace runner running in K8s, but it showed this error:

bash: docker: command not found

 

I have verified the runner is Online and below is the pipeline script:

 

pipelines:

custom:

pipeline:

- step:

name: Step1

size: 4x # default 4gb, 8x for 32gb

runs-on:

- 'self.hosted'

- 'linux'

script:

- echo "This step will run on a self hosted runner with 16 GB of memory.";

- docker --version

- step:

name: Step2

script:

- echo "This step will run on Atlassian's infrastructure as usual.";
image used: 
image: docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-runner


Pipeline:
https://bitbucket.org/acn-ce/temp-hanz/pipelines/results/8

 

Similar issue, but is not K8s runner:

https://confluence.atlassian.com/bbkb/docker-command-not-found-error-while-running-docker-commands-in-self-hosted-runner-1206785605.html

 

kubectl -n bitbucket-runner exec runner-vq4rw -c runner -- bash -c "ls /tmp/3d518a01-e540-5a30-836b-98973c55e83a"

docker

runner.log

 

kubectl -n bitbucket-runner exec runner-vq4rw -c runner -- bash -c "cat /tmp/3d518a01-e540-5a30-836b-98973c55e83a/runner.log"

[2023-07-20 07:38:19,930] Runner version: 1.489

[2023-07-20 07:38:19,976] Runner runtime: linux-docker

[2023-07-20 07:38:22,967] Copying Docker cli to working directory.

[2023-07-20 07:38:23,305] Starting websocket listening to RUNNER_UPDATED events.

[2023-07-20 07:38:23,502] Updating runner status to "ONLINE" and checking for new steps assigned to the runner after 0 seconds and then every 30 seconds.

[2023-07-20 07:38:23,752] Updating runner state to "ONLINE".

[2023-07-20 07:38:53,505] Updating runner state to "ONLINE".

[2023-07-20 07:39:23,505] Updating runner state to "ONLINE".

[2023-07-20 07:39:53,505] Updating runner state to "ONLINE".

. . . 

1 answer

1 accepted

0 votes
Answer accepted
Hanz Yu
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!
July 20, 2023

Suggest an answer

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

Atlassian Community Events