Forums

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

Sharing paths between docker instances in bitbucket pipeline selfhosted docker runner

Juan Peña
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!
October 20, 2025

I have installed a docker selfhosted runner on my machine.

I'm running it like this (via systemctl)

ExecStart=/usr/bin/docker run -t --init \
--memory 4096m \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp:/tmp:z \
-v /var/lib/docker/containers:/var/lib/docker/containers:ro \
-e ACCOUNT_UUID={myaccountid} \
-e RUNNER_UUID={myruunerid} \
-e RUNTIME_PREREQUISITES_ENABLED=true \
-e OAUTH_CLIENT_ID=mytokenouath \
-e OAUTH_CLIENT_SECRET=misecretooauth \
-e WORKING_DIRECTORY=/tmp \
--name runner-myruunerid \
docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-runner

 

In the host, i have /tmp/bitbucket-runner-shared
when the runner is executed, i can log into the docker and see that its able to see the folder

sudo docker exec -it runner-myruunerid /bin/bash
root@951b40abcc44:/opt/atlassian/pipelines/runner# ls /tmp/ | grep bitbucket-ru
bitbucket-runner-shared



I'm facing a problem into the dockers that the docker runner is spawning.
In the `bitbucket-pipelines.yml` i have this



- step:
name: "Debug: list files and selinux context"
runs-on: [self.hosted, linux, workspace, docker]
volumes:
- /tmp/bitbucket-runner-shared:/tmp/bitbucket-runner-shared:z
script:
- echo "--- Verifying files under /tmp/ ---"
- ls -lZ /tmp/


and the output of this step is


+ ls -lZ /tmp/
total 4
drwxr-xr-x. 6 root root system_u:object_r:container_ro_file_t:s0 57 Oct 20 19:43 a5441298-910c-5d64-a85d-77843be66aac

drwxr-xr-x. 2 root root system_u:object_r:container_ro_file_t:s0 6 Oct 30 2017 hsperfdata_root
-rw-------. 1 root root system_u:object_r:container_ro_file_t:s0 24 Oct 20 19:43 tmp.L6BtpU4ly



So its obviously not mounting /tmp/bitbucket-runner-shared even though I used 

volumes:
- /tmp/bitbucket-runner-shared:/tmp/bitbucket-runner-shared:z




What am i missing?

 

0 answers

Suggest an answer

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

Atlassian Community Events