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"
but
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?
Hi @nioanto,
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.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.