Skip to content

Conversation

@nayihz
Copy link
Contributor

@nayihz nayihz commented Mar 8, 2025

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

There are some warnings when build image.

=> WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 5)                                                                   0.0s
=> WARN: InvalidDefaultArgInFrom: Default value for ARG ${BUILDER_IMAGE} results in empty or invalid base image name (line 5)                   0.0s
=> WARN: InvalidDefaultArgInFrom: Default value for ARG ${BASE_IMAGE} results in empty or invalid base image name (line 32)

Special notes for your reviewer

Does this PR introduce a user-facing change?


@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Mar 8, 2025
Copy link
Member

@kerthcet kerthcet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nayihz left some comments, not mandatory but part of the project style I think.

@@ -1,10 +1,10 @@
ARG BASE_IMAGE
ARG BUILDER_IMAGE
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use makefile in our project, use Dockerfile directly is not a recommended way, and we don't want to spread the configurations across the project, for example, once the golang version changes, we only need to update the Makefile, which makes more sense to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So let's not pass the args to the Dockerfile at all. Default it in the Makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the official documentation, it is recommended to set a default value in Dockerfile. Otherwise there will be warning messages.
https://docs.docker.com/reference/build-checks/invalid-default-arg-in-from/#examples

once the golang version changes, we only need to update the Makefile

This is just the default values which only take effect when these parameter is not provided. I think we still could only need to update Makefile in this scenario.

@kerthcet
Copy link
Member

/lgtm
/approve

Thanks @nayihz

@kerthcet
Copy link
Member

/kind cleanup

@InftyAI-Agent InftyAI-Agent added lgtm Looks good to me, indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 10, 2025
@InftyAI-Agent InftyAI-Agent added cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Mar 10, 2025
@InftyAI-Agent InftyAI-Agent merged commit 5c719ec into InftyAI:main Mar 10, 2025
29 checks passed
@nayihz nayihz deleted the fix_dockerfile branch March 10, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Looks good to me, indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants