如何从BitBucket管道启动声纳扫描仪docker图像?

如何从BitBucket管道启动声纳扫描仪docker图像?,docker,sonarqube,bitbucket,bitbucket-pipelines,sonarscanner,Docker,Sonarqube,Bitbucket,Bitbucket Pipelines,Sonarscanner,我必须从已经配置好的声纳扫描仪上运行。问题是,我对所有这些都是新手:BitBucket、声纳扫描仪、docker,我需要以一种方式整合它们,从现在开始,我只能从BitBucket运行声纳扫描仪,然后使用声纳扫描仪的更高级分析 我试着用声纳扫描仪使用docker图像,但没有成功构建它。所以我直接从GitHub获得了它,但没有设法从bitbucket使用它 我查看了这个线程,但它使用的是GitLab,尽管它与我需要的类似: 比特桶管道.yml # This is a sample build c

我必须从已经配置好的声纳扫描仪上运行。问题是,我对所有这些都是新手:BitBucket、声纳扫描仪、docker,我需要以一种方式整合它们,从现在开始,我只能从BitBucket运行声纳扫描仪,然后使用声纳扫描仪的更高级分析

我试着用声纳扫描仪使用docker图像,但没有成功构建它。所以我直接从GitHub获得了它,但没有设法从bitbucket使用它

我查看了这个线程,但它使用的是GitLab,尽管它与我需要的类似:

比特桶管道.yml


# This is a sample build configuration for Docker.
# Check our guides at https://confluence.atlassian.com/x/O1toN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: atlassian/default-image:2

pipelines:
  default:
    - step:
        services:
          - docker
        script: # Modify the commands below to build your repository.
          # Set $DOCKER_HUB_USERNAME and $DOCKER_HUB_PASSWORD as environment variables in repository settings
          - export IMAGE_NAME=emeraldsquad/sonar-scanner:$BITBUCKET_COMMIT

          # build the Docker image (this will use the Dockerfile in the root of the repo)
          #RETURNS ERROR - docker build -t $IMAGE_NAME .
          # authenticate with the Docker Hub registry
          - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
          # push the new Docker image to the Docker registry
          - docker push $IMAGE_NAME