Closed cwkang1998 closed 2 years ago
Thanks for raising @cwkang1998, I've been dealing with this issue locally for a few months as well. I was hoping that this would fix itself as image authors create builds for both architectures over time. Any ideas for getting this working now without changing to non-official images are appreciated!
To get this to work on M1:
const container = await new MySqlContainer('mysql:5.7.32').start();
I had to pull the image manually, on the linux/x86_64
platform:
docker pull --platform linux/x86_64 mysql:5.7.32
Expected Behaviour Tests to run as expected as a windows or linux machine.
Actual Behaviour Tests failing. Attached are the failing tests.
Testcontainer Logs Its a long log, so not going to include everything here, focusing on docker-compose-environment test
Steps to Reproduce
npm run test
in a mac machine with m1 chipEnvironment Information
Additional comments This does not really affect this package as a whole, and are more of a developer experience improvement for those using M1 machines.
Regarding most of the image not found error, most likely the cause is due to M1 having a
arm64
as its architecture string identifier, and as such when it attempts to look for it in the docker registry it fails. In fact, I believe that most error happens only because the image forarm64
is not found (as far as I knowaarch64
isarm64
, but I think docker for mac does not automatically associate the both as the same. https://stackoverflow.com/questions/31851611/differences-between-arm64-and-aarch64)Actually not quite sure if this package should even handle this issue, or this should be reported here. Feel free to close this if its not relevant.
Tested on windows machine on WSL2, and all the tests run fine (except for tests involving private registry)