> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/developer-tools/integrations/snyk-ci-cd-integrations/snyk-images-guides-to-migration/bitbucket-pipelines-migration.md).

# BitBucket Pipelines migration

## For users of `snyk/snyk-scan` < v1.0.0 <a href="#users-using-snyk-snyk-scan-less-than-v1.0.0" id="users-using-snyk-snyk-scan-less-than-v1.0.0"></a>

`snyk/snyk-scan` \<v1.0.0 uses Snyk CLI Images. As all Snyk CLI Images will be removed, `snyk/snyk-scan` < v1.0.0 will stop working also.

See the [upgrade guide in Snyk Docs](/developer-tools/integrations/snyk-ci-cd-integrations/bitbucket-pipelines-integration-using-a-snyk-pipe/migrating-to-bitbucket-pipelines-v1.0.0.md) to upgrade to `snyk/snyk-scan` >= v1.0.0

## For users of `snyk/snyk-scan` >= v1.0.0 <a href="#users-using-snyk-snyk-scan-greater-than-v1.0.0" id="users-using-snyk-snyk-scan-greater-than-v1.0.0"></a>

### Create your own custom image <a href="#create-your-own-custom-image" id="create-your-own-custom-image"></a>

Users can create their own custom images to use. This option is available for `snyk/snyk-scan` >= v1.0.0 only. For details, see [User-defined custom images for CLI.](/developer-tools/integrations/snyk-ci-cd-integrations/user-defined-custom-images-for-cli.md)

Creating a custom image should guarantee compatibility with your system. However, there are alternative images to which you can upgrade if creating a custom image is not possible.

### Upgrade to a supported Snyk Image <a href="#upgrade-to-a-supported-snyk-image" id="upgrade-to-a-supported-snyk-image"></a>

After you have validated that you are using a Snyk Image that will be removed, as outlined [for users of `snyk/snyk-scan` < v1.0.0](#users-using-snyk-snyk-scan-less-than-v1.0.0), refer to the [Snyk images migration](/developer-tools/integrations/snyk-ci-cd-integrations/snyk-images-guides-to-migration/snyk-images-migration.md) guidelines to view upgrade paths for your configuration.

{% hint style="info" %}
Remember to use pinned versions where available for better stability. for example, `snyk/snyk:dotnet-8.0` is preferable to `snyk/snyk:dotnet`
{% endhint %}

An example follows of upgrading to a supported Snyk Image.

In the example `bitbucket-pipeline.yml` configuration that follows, a Snyk image is configured that will be removed on 12 Aug 2024:

```yaml
#  Example bitbucket-pipelines.yml using `snyk/snyk:node-16` Snyk Image
#  Template NodeJS build

#  This template allows you to validate your NodeJS code.
#  The workflow allows running tests and code linting on the default branch.

image: atlassian/default-image:latest

pipelines:
  default:
    - parallel:
        - step:
            name: Build
            caches:
              - node
            script:
              - npm install
        - step:
            name: Snyk scan
            script:
              - pipe: snyk/snyk-scan:1.0.1
                variables:
                  SNYK_TOKEN: $SNYK_TOKEN
                  LANGUAGE: "node-16" # <------ Using the `snyk/snyk:node-16` Snyk Image
                  EXTRA_ARGS: "--all-projects" # Optional
                  DEBUG: "true" # Optional
```

Following the [Snyk images migration](/developer-tools/integrations/snyk-ci-cd-integrations/snyk-images-guides-to-migration/snyk-images-migration.md) guidelines, you can upgrade to a supported Snyk Image as shown here:

```yaml
#  Upgrading to supported Snyk Image `snyk/snyk:node-22`
#  Template NodeJS build

#  This template allows you to validate your NodeJS code.
#  The workflow allows running tests and code linting on the default branch.

image: atlassian/default-image:latest

pipelines:
  default:
    - parallel:
        - step:
            name: Build
            caches:
              - node
            script:
              - npm install
        - step:
            name: Snyk scan
            script:
              - pipe: snyk/snyk-scan:1.0.1
                variables:
                  SNYK_TOKEN: $SNYK_TOKEN
                  LANGUAGE: "node-22" # <------ Upgrade to the `snyk/snyk:node-22` Snyk Image
                  EXTRA_ARGS: "--all-projects" # Optional
                  DEBUG: "true" # Optional
```

## Download and install Snyk CLI directly <a href="#download-and-install-snyk-cli-directly" id="download-and-install-snyk-cli-directly"></a>

If you do not want to use the Bitbucket `snyk/snyk-scan` integration, you have the option to install and use the Snyk CLI directly.

{% hint style="info" %}
If you use this option, you will be unable to use integration features such as Code Insight Results
{% endhint %}

The following example shows using the CLI directly.

In the example `bitbucket-pipeline.yml` configuration that follows, a pipeline is configured that does the following:

* Downloads the CLI
* Validates the CLI with a SHASUM check
* Runs the CLI to test the code

```yaml
image: node:18

pipelines:
  default:
    - step:
        name: Build
        caches:
          - node
        script:
          - npm install
    - step:
        name: Snyk scan
        script:
          # Download Snyk Linux CLI
          - curl https://downloads.snyk.io/cli/latest/snyk-linux -o snyk-linux
          # Download Snyk Linux CLI SHASUM
          - curl https://downloads.snyk.io/cli/latest/snyk-linux.sha256 -o snyk.sha256
          # Validate binary using SHASUM
          - sha256sum -c snyk.sha256
          # Configure CLI for executtion
          - chmod +x snyk-linux
          - mv snyk-linux /usr/local/bin/snyk
          # Run Snyk CLI
          - snyk test --all-projects -d
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.snyk.io/developer-tools/integrations/snyk-ci-cd-integrations/snyk-images-guides-to-migration/bitbucket-pipelines-migration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
