Skip to content

Let users specify the Dockerfile path in Auto-DevOps

Problem to solve

Not all projects have a Dockerfile at the root of their tree, leading to use Heroku Buildpacks in lieu of the project's file.

Intended users

Further details

We just test the existence of the file at the root of the project: https://gitlab.com/gitlab-org/cluster-integration/auto-build-image/-/blob/7b005a39fc3556edd42547f100ce109d1ad1ccdf/src/build.sh#L16-21

Proposal

Alternatively, an env var could be set to specify the path of the project's Dockerfile to use. I don't think we should browse the file system for these files, as it could lead to a breaking change, and many "false positives" (an example file being used).

As we already use DOCKERFILE_PATH for Container Scanning remediations, we should re-use the same name for consistency and simplicity.

Permissions and Security

Users need to have access to the project variables if they don't include the auto-devops template.

Documentation

Update https://docs.gitlab.com/ee/topics/autodevops/index.html#auto-build-using-a-dockerfile

Availability & Testing

TBD

What does success look like, and how can we measure that?

More projects being supported by auto-devops.

What is the type of buyer?

GitLab Core

Is this a cross-stage feature?

No.

Links / references

A confused user: #211967 (closed)

Edited by Philippe Lafoucrière