Issue: The command for building the image in docs/syncserver/README.md does not include the --platform flag which prevents the image from running across all architectures. For example, if I build the image on an ARM system and then try running on x86, it won’t work.
Solution: This issue can be fixed by using docker buildx and adding the flag to include all of the platforms. I have tested this by building the image with the linux/arm64 and linux/amd64 platform flags on an ARM system and then running a container with that image on an x86 system. This would be useful in scenarios where the syncserver runs on devices that cannot do builds.
The correct command would be:
# Builds for all existing platforms supported by Docker
docker buildx build -f <Dockerfile> --platform linux/amd64,linux/arm64,windows/amd64 --no-cache --build-arg ANKI_VERSION=<version> -t anki-sync-server .
Reference:
https://docs.docker.com/build/building/multi-platform/