Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: determine platform details from local docker installation for jibDockerBuild #4249
feat: determine platform details from local docker installation for jibDockerBuild #4249
Changes from 2 commits
cfdfc76
888d780
c209b14
f6fb53a
1dee2d4
83805fc
877ae0e
ca74068
f16f6a7
8f81743
b399f5e
5e5e033
d941895
bb7c98d
6edce95
c96ac7f
f7121d1
8eadc59
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we get the mapping between the architecture from docker info and the architecture needed for docker build? Are
x86_64
andaarch64
all we need? Also please add unit tests for all the cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mapping was retrieved from https://docs.docker.com/engine/install/#supported-platforms. From the documented architectures, "x86_64" and "aarch64" appear to be the only ones with alternative naming? I've also added a source code comment.
Done, added unit testing in StepsRunnerTest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so the root cause is that the architecture returned from
docker info
is different from the architecture used bydocker build
. If that's the case, maybe we can change the method name to something likemapDockerInfoArchitechtureToDockerBuildArchitechture
? OrtoDockerBuildArchitecture(String dockerInfoArchitecture)
if we think the previous one is too verbose?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, the naming doesn't seem to be standardized everywhere. While
docker info
results inx86_64
on my machine,docker manifest inspect
on images usesamd64
which is supposed to be equivalent (docker/docs#4295).Renaming the method is a good idea. Alternatively, what are your thoughts on
normalizeArchitecture()
orstandardizeArchitecture()
? I found a couple of references that do something similar:(1)https://github.com/containerd/platforms/blob/c1438e911ac7596426105350652fe267d0fb8a03/database.go#L76
(2)https://github.com/openzipkin/zipkin/blob/2f0a26fd4e3f3ea24e9fb30f55a84ebbc194129c/build-bin/docker/docker_arch#L7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions! I like
normalizeArchitecture()
.