Howto use docker commands inside a step running in a Runner

Jose A. Illescas (Eulen)
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!
August 3, 2022

It's possible use docker command inside Runners as currently I do with steps-on-cloud? (I try this: https://support.atlassian.com/bitbucket-cloud/docs/run-docker-commands-in-bitbucket-pipelines/ but doesn't works inside a runner:

    Error: docker command not found

Doesn't work:

    options:

        docker: true

Doesn't work:

    - step:

        services:

            - docker

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 10, 2022

Hi @Jose A. Illescas (Eulen),

  • Have you perhaps defined a variable named PATH as a repository, workspace or deployment variable? The shell uses PATH to find commands, so if you replace its usual list of locations then commands like docker won't work anymore.

  • What kind of runner are you using? Is it a Linux, Windows, or MacOS runner? And what is the runner's version?

Kind regards,
Theodora

0 votes
Jose A. Illescas (Eulen)
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!
August 3, 2022

I try this, see "Custom docker-in-docker image"

 

    But I get same error, "bash: docker: command not found"

    

definitions:

    services:

        docker:

            image: docker:dind

pipelines:

    default:

        - step:

            runs-on: self.hosted

            services:

                - docker

            script:

                - docker-command-here

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events