Open masabow123 opened 2 years ago
@masabow123 Could you try setting the following environment variables in the target pipeline?
DOCKLE_HOST: "unix:///var/run/docker.sock"
Thank you for your update. We already tried your suggestion. (Because, we also found this issue -> https://github.com/aquasecurity/trivy/issues/2432)
■Azure Pipeline bash task
▼pattern1
bash: dockle --debug --exit-code 1 --exit-level $variables.dockleExitLevel $variables.containerRepositoryName/$variables.containerImageName:$(fullVersion)
env:
DOCKLE_HOST: "unix:///var/run/docker.sock"
displayName: 'Dockle Scan Container'
workingDirectory: $(Build.SourcesDirectory)
▼pattern2
bash: dockle --debug --exit-code 1 --exit-level $variables.dockleExitLevel $variables.containerRepositoryName/$variables.containerImageName:$(fullVersion)
env:
DOCKLE_HOST: "unix:///var/run/docker.sock"
XDG_RUNTIME_DIR: "/var/run"
displayName: 'Dockle Scan Container'
workingDirectory: $(Build.SourcesDirectory)
■Dockle error
2022-09-29T05:49:40.7706729Z ##[section]Starting: Dockle Scan Container
2022-09-29T05:49:40.7716728Z ==============================================================================
2022-09-29T05:49:40.7717070Z Task : Bash
2022-09-29T05:49:40.7717357Z Description : Run a Bash script on macOS, Linux, or Windows
2022-09-29T05:49:40.7717642Z Version : 3.201.1
2022-09-29T05:49:40.7717875Z Author : Microsoft Corporation
2022-09-29T05:49:40.7718555Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2022-09-29T05:49:40.7719125Z ==============================================================================
2022-09-29T05:49:40.9628913Z Generating script.
2022-09-29T05:49:40.9653133Z Script contents:
2022-09-29T05:49:40.9654787Z dockle --debug --exit-code 1 --exit-level fatal ***/XXXXXX:0.3.45-build.12
2022-09-29T05:49:40.9663900Z ========================== Starting Command Output ===========================
2022-09-29T05:49:40.9682924Z [command]/usr/bin/bash /data/infra/work/azure_work/_temp/44503a27-9b9b-476d-bed6-dde2ddb9a7fd.sh
2022-09-29T05:49:41.0010355Z 2022-09-29T05:49:40.999Z [35mDEBUG[0m There is no .dockleignore file
2022-09-29T05:49:41.0012254Z 2022-09-29T05:49:40.999Z [35mDEBUG[0m Skipped update confirmation
2022-09-29T05:49:41.0016635Z 2022-09-29T05:49:40.999Z [35mDEBUG[0m Start assessments...
2022-09-29T05:49:56.2630309Z 2022-09-29T05:49:56.262Z [31mFATAL[0m unable to initialize a image struct:
2022-09-29T05:49:56.2631711Z github.com/goodwithtech/deckoder/extractor/docker.newDockerExtractor
2022-09-29T05:49:56.2632925Z /home/runner/go/pkg/mod/github.com/goodwithtech/deckoder@v0.0.1/extractor/docker/docker.go:73
2022-09-29T05:49:56.2634798Z - failed to initialize source:
2022-09-29T05:49:56.2635897Z github.com/goodwithtech/deckoder/extractor/image.NewImage
2022-09-29T05:49:56.2637316Z /home/runner/go/pkg/mod/github.com/goodwithtech/deckoder@v0.0.1/extractor/image/image.go:86
2022-09-29T05:49:56.2638666Z - manifest unknown: manifest tagged by "0.3.45-build.12" is not found
2022-09-29T05:49:56.2640491Z reading manifest 0.3.45-build.12 in ***/XXXXXX
2022-09-29T05:49:56.2641626Z github.com/containers/image/v5/docker.(*dockerImageSource).fetchManifest
2022-09-29T05:49:56.2642865Z /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.19.1/docker/docker_image_src.go:202
2022-09-29T05:49:56.2644109Z github.com/containers/image/v5/docker.(*dockerImageSource).ensureManifestIsLoaded
2022-09-29T05:49:56.2645366Z /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.19.1/docker/docker_image_src.go:229
2022-09-29T05:49:56.2646407Z github.com/containers/image/v5/docker.newImageSourceAttempt
2022-09-29T05:49:56.2647735Z /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.19.1/docker/docker_image_src.go:133
2022-09-29T05:49:56.2649224Z github.com/containers/image/v5/docker.newImageSource
2022-09-29T05:49:56.2650293Z /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.19.1/docker/docker_image_src.go:75
2022-09-29T05:49:56.2651447Z github.com/containers/image/v5/docker.dockerReference.NewImageSource
2022-09-29T05:49:56.2652912Z /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.19.1/docker/docker_transport.go:144
2022-09-29T05:49:56.2654354Z github.com/goodwithtech/deckoder/extractor/image.newSource
2022-09-29T05:49:56.2655688Z /home/runner/go/pkg/mod/github.com/goodwithtech/deckoder@v0.0.1/extractor/image/image.go:109
2022-09-29T05:49:56.2656795Z github.com/goodwithtech/deckoder/extractor/image.NewImage
2022-09-29T05:49:56.2657847Z /home/runner/go/pkg/mod/github.com/goodwithtech/deckoder@v0.0.1/extractor/image/image.go:84
2022-09-29T05:49:56.2658978Z github.com/goodwithtech/deckoder/extractor/docker.newDockerExtractor
2022-09-29T05:49:56.2660101Z /home/runner/go/pkg/mod/github.com/goodwithtech/deckoder@v0.0.1/extractor/docker/docker.go:71
2022-09-29T05:49:56.2661249Z github.com/goodwithtech/deckoder/extractor/docker.NewDockerExtractor
2022-09-29T05:49:56.2662912Z /home/runner/go/pkg/mod/github.com/goodwithtech/deckoder@v0.0.1/extractor/docker/docker.go:57
2022-09-29T05:49:56.2663974Z github.com/goodwithtech/dockle/pkg/scanner.ScanImage
2022-09-29T05:49:56.2664856Z /home/runner/work/dockle/dockle/pkg/scanner/scan.go:41
2022-09-29T05:49:56.2666049Z github.com/goodwithtech/dockle/pkg.Run
2022-09-29T05:49:56.2666890Z /home/runner/work/dockle/dockle/pkg/run.go:87
2022-09-29T05:49:56.2667715Z github.com/urfave/cli.HandleAction
2022-09-29T05:49:56.2668589Z /home/runner/go/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:526
2022-09-29T05:49:56.2669754Z github.com/urfave/cli.(*App).Run
2022-09-29T05:49:56.2670756Z /home/runner/go/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:288
2022-09-29T05:49:56.2671515Z main.main
2022-09-29T05:49:56.2672384Z /home/runner/work/dockle/dockle/cmd/dockle/main.go:12
2022-09-29T05:49:56.2673125Z runtime.main
2022-09-29T05:49:56.2673978Z /opt/hostedtoolcache/go/1.16.15/x64/src/runtime/proc.go:225
2022-09-29T05:49:56.2674869Z runtime.goexit
2022-09-29T05:49:56.2675980Z /opt/hostedtoolcache/go/1.16.15/x64/src/runtime/asm_amd64.s:1371
2022-09-29T05:49:56.2703872Z ##[error]Bash exited with code '1'.
2022-09-29T05:49:56.2752381Z ##[section]Finishing: Dockle Scan Container
Hello Team
I tried to scan the docker image with dockle but I got the following error. Could you please tell me the cause and the fundamental countermeasure?
Environment
Thanks
dockle --debug