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
- Create a repository with a Dockerfile
- Build the docker image
- Scan the image using the template and
CS_MAJOR_VERSION: 4
Example .gitlab-ci.yml
Example Project
- Project branch (ignore branch name; it's not actually private) https://gitlab.com/thiagocsf-group/demo/docker-push-test/-/tree/test-private-container-scanning
- Error in job output: https://gitlab.com/thiagocsf-group/demo/docker-push-test/-/jobs/1269533773#L24
- Also reported by a user: https://gitlab.com/gitlab-org/gitlab/-/issues/330870#note_576633818
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ó