scout-cli icon indicating copy to clipboard operation
scout-cli copied to clipboard

Docker scout is not beeing found ater running the install script in azure pipelines

Open achainarong opened this issue 2 years ago • 4 comments
trafficstars

Hey guys,

i followed your guide on the docker website. But when trying to run docker scout i get the error "docker 'scout' is not a docker command". And when i try to use the downloaded exectuable ~/.docker/cli-plugins/docker-scout i get the message that i should login into Dockerhub first even though i tried it over the pipeline with the command docker login and with the serviceconnection from azure itself.

achainarong avatar Aug 30 '23 13:08 achainarong

  • 1 Same issue following the installion steps provided (https://docs.docker.com/scout/integrations/ci/azure/) to use with azure pipelines

sc-rpt avatar Oct 17 '23 17:10 sc-rpt

I had the same issue but used the following workaround:

          - task: CmdLine@2
            displayName: Find CVEs on image
            env:
              INSTALL_DIR: $(Pipeline.Workspace)/cli-plugins
            inputs:
              script: |
                # Install the Docker Scout CLI
                curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s -- -b ${INSTALL_DIR}
                # Get a CVE report for the built image and fail the pipeline when critical or high CVEs are detected
                DOCKER_SCOUT_HUB_USER=$(DOCKER_HUB_USER) DOCKER_SCOUT_HUB_PASSWORD=$(DOCKER_HUB_PAT) $(INSTALL_DIR)/docker-scout cves $(image):$(tag) --exit-code --only-severity critical,high

alex-arana avatar Mar 04 '24 02:03 alex-arana

Another solution could be using absolute path:

- task: CmdLine@2
  displayName: Install Docker Scout
  inputs:
    script: |
      # Install the Docker Scout CLI
      curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s --

      /home/vsts/.docker/cli-plugins/docker-scout version

However, installation steps provided for azure pipeline do not work!

salvorusso avatar May 30 '24 15:05 salvorusso

Thanks @salvorusso, your solution worked for me.

I did a little change:

  - task: CmdLine@2
    inputs:
      script: |
        # Install Docker Scout CLI
        curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s --
        export PATH=$PATH:/home/vsts/.docker/cli-plugins
        
        # Verify version
        docker-scout version
    displayName: "Install Docker Scout"

dloperab avatar Nov 29 '24 01:11 dloperab