fix: fix some warnings when building images#295
Conversation
| @@ -1,10 +1,10 @@ | |||
| ARG BASE_IMAGE | |||
| ARG BUILDER_IMAGE | |||
| ARG BASE_IMAGE=gcr.io/distroless/static:nonroot | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
So let's not pass the args to the Dockerfile at all. Default it in the Makefile.
There was a problem hiding this comment.
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.
|
/lgtm Thanks @nayihz |
|
/kind cleanup |
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes #
There are some warnings when build image.
Special notes for your reviewer
Does this PR introduce a user-facing change?