Skip to content

Misleading Dockerfile not found error in container-scanning

Summary

The scan fails with the following message:

[ERROR] [2021-05-13 03:49:50 +0000] []  ▶  Can not find Dockerfile in /builds/thiagocsf-group/demo/docker-push-test/Dockerfile

For some reason, it looks like it cant find the Dockerfile, even though it is in the root directory of the project.

Steps to reproduce

  1. Create a repository with a Dockerfile
  2. Build the docker image
  3. Scan the image using the template and CS_MAJOR_VERSION: 4

Example .gitlab-ci.yml

Example Project

What is the current bug behavior?

The scan job exists without performing the scan

What is the expected correct behavior?

The given image is scanned but remediations are disabled.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Thiago Figueiró