I need to build a docker image for arm64 and amd64, and I’ve already used buildx
.
But the build process for the two platform is lightly different and I would need to use two different Dockerfiles. How should I do?
The detail: the image use s6-overlay and it has two different tarballs depending on the arch
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-aarch64.tar.xz /tmp
2
Answers
solution: https://github.com/just-containers/s6-overlay/issues/512#issuecomment-1421339335
You probably want to create an image that the two dockerfiles can share and do a multi-stage build process. See here in the docker docs