Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

How to configure the docker service in self hosted runner?

Edited

According to the documentation at: 

https://support.atlassian.com/bitbucket-cloud/docs/pipelines-runners-frequently-asked-questions/

"How do I set up proxy for docker images?

With a self-hosted runner you can use a custom docker-in-docker service.

services:
docker:
image:   docker:dind
environment:
HTTP_PROXY: "http://username:password@proxy2.domain.com"
HTTPS_PROXY: "http://username:password@proxy2.domain.com"



Well, I'm doing that on self hosted runner and getting an error saying that I need to use a self hosted runner....

"The 'services' section in your bitbucket-pipelines.yml file contains a custom docker service. Remove 'image', 'variables' and 'environment' from the docker service definition or use a self-hosted runner for the step."



Below one of the many attempts that failed....

definitions:
services:
docker:
image: docker:dind
environment:
HTTP_PROXY: "http://localhost"
HTTPS_PROXY: "https://localhost"

image: alpine:latest

pipelines:
branches:
main:
- step:
name: Build Deploy rev-proxy
runs-on: mylocalrunner
script:
- ping localhost -c 1
services:
- docker

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 28, 2021

Hi Rafael,

The runs-on parameter in the yaml file must contain a label named self.hosted. I believe that culprit here is that your yaml file has only the mylocalrunner label, so Pipelines doesn't see that step as a step that will run on your local runner.

You can modify the runs-on parameter as follows:

runs-on:
- self.hosted
- mylocalrunner

and this should allow the step to run on your runner. The label mylocalrunner should also exist on the runner you configured on Bitbucket website either from the repository settings or from the workspace settings.

Please feel free to let me know how it goes and if you have any questions!

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events