Chapter 11+, Book versions [3, 4] Apple Silicon

The chapter on testing includes a conclusion section regarding docker-compose for linux unit test virtualization on local machine.

I feel that this is a very important thing to experience/understand, and I have enjoyed the attention paid to actual production concerns thus far in the course.

However, when building on Apple Silicon, there are a few issues with the swift images from docker, as well as issues running other tools built for x64 or AMD64. I have had quite a difficult time determining the best fix, or even where best to apply it.

Specifying a swift image that’s compatible with local system ISA? Running rosetta 2 around docker and downloading the x64 version? changing something else in one of the compose files? Building my own swift image and then trying to take a break from vapor to learn enough docker to be sure I’m properly achieving the same goal?

I eventually decided the easiest thing was just deploying my vapor app to a remote server I own, and running the tests locally there through an ssh… but this sort of circumvents the purpose of the chapter.

Any guidance on best practices to remedy this issue would be an appreciated addendum / errata, so that if we select Vapor in a production capacity in the future I can give guidance to my team.

Thanks if anyone responds to this in the future.

Replying to my own post here:

Tim himself has recommended recently to use the swift nightlies for their multi-platform compatibility.

That also sort of solves this problem, so we can probably assume this is a good recommendation for now.

See his reply to a similar question here

Additionally, you may experience an issue with Buildkit that prevents certain image compatibility from finishing. A possible workaround may be to disable buildkit on the Apple Silicon version of Docker. Docker desktop → Settings → Docker Engine → Change the "features": { buildkit: true} to "features": { buildkit: false}.

See HERE for more info on this particular hangup.