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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,915
Community Members
 
Community Events
176
Community Groups

Self hosted runner: Execute command from Bitbucket runner to another container

Edited

Hi to all,

on my personal host I have a 3 container:

  •  .Bitbucker runner
  • . debian with dpkg-buildpackage script
  • . apache web server

When I login inside Bitbucket runner container, from inside  I can do it  "docker ps ",    the output is that:

output.PNG

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?

 

1 answer

0 votes

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

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events