You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi to all,
on my personal host I have a 3 container:
When I login inside Bitbucket runner container, from inside I can do it "docker ps ", the output is that:
from Bitbucker runner container I can do docker ps; "docker exec -it container_name foo_bar" and/or "docker run"
When I run my pipeline:
image: atlassian/default-image:3 options: docker: true pipelines: default: - step: name: 'execute command from external container' script: - docker exec -itu infallible_vaughan any_command_you_want
I retrive this error:
Error: No such container:
someone can help me to use the container that are running on my server from Bitbucket pipeline?
In order to provide isolation and reproducibility, a runner doesn’t provide access directly to the host file system, so it is not possible to access any Docker containers that are running on the host machine during a Pipelines (runner) build.
You could run a docker container during the build with a docker run command in your yml file and it should then be possible to execute docker commands in that container with docker exec, but without the -it options, as they aren't supported in Pipelines.
Also, just a heads up, you need to add a runs-on parameter to a step in the bitbucket.pipelines.yml file with at least the self-hosted label, in order for the build to run on your runner:
I'm not sure if you have that already in the yml file of your repo and removed it when you copied and pasted the contents of the yml file here, I just mention it in case it's missing.