Using Docker commands protected by Pipelines in Runners

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Currently, there are a few commands from the Docker API that are blocked by Pipelines when you attempt to run them. The following error message is thrown when you attempt to run any of these commands:

1 Error response from daemon: authorization denied by plugin pipelines

The list of blocked Docker commands can be found on this page:

https://support.atlassian.com/bitbucket-cloud/docs/run-docker-commands-in-bitbucket-pipelines/

⚠️ Please note that this is not a fully comprehensive list, and there may be other commands that are not supported. Please reach out to Atlassian Support or the Atlassian community if you wish to confirm if a certain command is blocked or not.

As a workaround, users can utilize Runners as a workaround to execute these commands, but some configuration is required in the bitbucket-pipelines.yml file. This page explains how you can use these commands in a Bitbucket Pipelines Runners environment.

Environment

Bitbucket Pipelines

Solution

  1. Set up a custom Docker service. This is crucial to allow you to bypass the block, as the default Docker service will also block the command from being executed:

    1 2 3 4 5 definitions: services: docker-custom: type: docker image: docker:dind
  2. On the step that needs to execute the blocked command, enable the custom Docker service:

    1 2 services: - docker-custom

ℹ️Complete YML file example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 definitions: services: docker-custom: type: docker image: docker:dind pipelines: default: - step: runs-on: - 'self.hosted' - 'linux' services: - docker-custom script: - <Your-Docker-Command-Here>
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.