# Error: Service 'docker' is unavailable. Please check that the service is running and accessible.

- **ID:** `cicd/bitbucket-pipeline-service-unavailable`
- **Domain:** cicd
- **Category:** system_error
- **Error Code:** `SERVICE_UNAVAILABLE`
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Bitbucket Pipelines cannot start the Docker service because the pipeline's build container lacks Docker daemon access or the service definition in bitbucket-pipelines.yml is misconfigured.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Bitbucket Pipelines 2024 | active | — | — |
| Docker 24.0 | active | — | — |
| Ubuntu 22.04 | active | — | — |

## Workarounds

1. **Add the Docker service to bitbucket-pipelines.yml:
definitions:
  services:
    docker:
      image: docker:24.0
pipelines:
  default:
    - step:
        services:
          - docker
        script:
          - docker info** (85% success)
   ```
   Add the Docker service to bitbucket-pipelines.yml:
definitions:
  services:
    docker:
      image: docker:24.0
pipelines:
  default:
    - step:
        services:
          - docker
        script:
          - docker info
   ```
2. **Use a Bitbucket pipeline image that includes Docker pre-installed, such as atlassian/default-image:4** (75% success)
   ```
   Use a Bitbucket pipeline image that includes Docker pre-installed, such as atlassian/default-image:4
   ```

## Dead Ends

- **Add 'docker: true' to the step definition without defining services** — Docker service must be explicitly listed under 'services:' in the pipeline YAML (90% fail)
- **Use a custom Docker image without checking if it has Docker installed** — The service requires Docker daemon, which may not be present in custom images (70% fail)
- **Set DOCKER_HOST environment variable to a remote daemon** — Bitbucket Pipelines blocks external network connections from services for security (85% fail)
