Dockerfile: fix typo in build vs. target platform #18
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.
Description
This fixes a problem with cross building the docker image where the wrong rust toolchain would be used resulting in:
and also getting the wrong architecture dependencies (like onnxruntime and lib-ssl deps)
Essentially, this uses the target architecture as the base image and the docker buildx's cross architecture buildkit to get all the right bits for the target architecture.
This significantly slows down builds (gotta love rust?) since this now builds everything across architectures and gets cross architecture dependencies. I'm not sure if this is the best approach but I don't see a great alternative since there are cross system dependencies that need to also match the right architecture, i.e., the onnx runtime.
Simply doing
will only get us the correct rust binary, not the right other dependencies.
Anyways, if someone has any ideas, would love to hear them!!
What type of PR is this? (check all applicable)
Related Tickets & Documents
Related to #15
Mobile & Desktop Screenshots/Recordings
N/a
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
Already built and tested in the cloud with a cross architecture machine.
[optional] What gif best describes this PR or how it makes you feel?