I've been working on a Vapor app, and now I want to deploy it to linux/amd64. I've got it containerized and working on my M1 Mac, but when I try to build the linux/amd64 version of the Docker image, it fails with
#0 311.2 Working copy of https://github.com/vapor/fluent-kit.git resolved at 1.36.1
#0 311.3 Creating working copy for https://github.com/apple/swift-nio-http2.git
#0 312.5 Working copy of https://github.com/apple/swift-nio-http2.git resolved at 1.23.1
#0 313.9 error: 'fluent-mysql-driver': Invalid manifest (compiled with: ["/usr/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.9c4qco/vfs.yaml", "-L", "/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/usr/lib/swift/pm/ManifestAPI", "-swift-version", "5", "-I", "/usr/lib/swift/pm/ManifestAPI", "-package-description-version", "5.5.0", "/build/.build/checkouts/fluent-mysql-driver/Package.swift", "-Xfrontend", "-disable-implicit-concurrency-module-import", "-Xfrontend", "-disable-implicit-string-processing-module-import", "-o", "/tmp/TemporaryDirectory.FggUCI/fluent-mysql-driver-manifest"])
#0 313.9 qemu: uncaught target signal 4 (Illegal instruction) - core dumped
#0 314.0 error: 'jwt': Invalid manifest (compiled with: ["/usr/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.pPdOzm/vfs.yaml", "-L", "/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/usr/lib/swift/pm/ManifestAPI", "-swift-version", "5", "-I", "/usr/lib/swift/pm/ManifestAPI", "-package-description-version", "5.4.0", "/build/.build/checkouts/jwt/Package.swift", "-Xfrontend", "-disable-implicit-concurrency-module-import", "-Xfrontend", "-disable-implicit-string-processing-module-import", "-o", "/tmp/TemporaryDirectory.DL6QYW/jwt-manifest"])
#0 314.0 qemu: uncaught target signal 4 (Illegal instruction) - core dumped
#0 355.4 error: fatalError
------
Dockerfile:21
--------------------
19 | # files do not change.
20 | COPY ./Package.* ./
21 | >>> RUN swift package resolve
22 |
23 | # Copy entire repo into container
--------------------
ERROR: failed to solve: process "/bin/sh -c swift package resolve" did not complete successfully: exit code: 1
My build invocation looks like this:
docker build --platform linux/amd64 --build-arg QEMU_CPU=max --tag camsync:latest .
I'm using Docker v4.19.0. I'm not sure if the crash is due to the "Invalid manifest," which I'm not sure why it's invalid.