问题
QNAP ContainerStation supports searching for Docker images on Docker Hub. QNAP ContainerStation is supported on both their Intel and Arm platforms. I have an Intel and an Arm Image of my application, if user searches for image (songkong) both are displayed but of course only the Intel version will work on Intel QNAP and only Arm version will work on Arm QNAP.
It would be better for the customer if QNAP would just list the valid one, since QNAP dont make it very clear what the cpu is for their various models. Is there anything I can add to my Dockerfile, or anything I can within DockerHub repository to help QNAP do this ?
Update
Seems there is someway to create an image that supports multiple platforms (Multi-Arch). I assume what actually happens is you create separate images and then put some wrapper around them, then Docker users platform can automtically pick the correct version for their platform. But cannot see how I combine my Arm and Intel images into a MultiArch Image.
回答1:
If you're using an old version of Docker you have to use manifest-tool. There is a small tutorial in the README.md
of the repository or you can also follow this one.
If your Docker version is recent enough, you can directly use the docker manifest
command.
Then you can use it that way:
docker manifest create name/app:latest name/app:amd64 name/app:arm64
docker manifest push name/app:latest
Hope that helps.
来源:https://stackoverflow.com/questions/52794668/can-i-inform-qnap-if-my-docker-image-is-intel-or-arm