objection.js icon indicating copy to clipboard operation
objection.js copied to clipboard

Add support for arm architectures in docker-compose.yml

Open cesumilo opened this issue 11 months ago • 8 comments

Context

As a contributor, I would like to be able to run the docker-compose services on my ARM architecture machine (Macbook Pro M2).

Expected

docker-compose up # running

Actual

docker-compose up

[+] Running 1/2
 ⠙ mysql Pulling                                                                                                                                                                                                                                                                                                                                                                                                                               1.1s 
 ✘ postgres Error                                                                                                                                                                                                                                                                                                                                                                                                                              1.1s 
no matching manifest for linux/arm64 in the manifest list entries

cesumilo avatar Feb 28 '24 18:02 cesumilo

@lehni Here is the PR for QoL about ARM architectures

cesumilo avatar Feb 28 '24 18:02 cesumilo

Ok so the problem is that msysql doesn't have a manifest for linux/arm64. We should probably just switch to MariaDB instead, see: https://stackoverflow.com/a/65592942

lehni avatar Feb 29 '24 21:02 lehni

Or we could use docker-compose.override.yml, see: https://stackoverflow.com/a/68791503

lehni avatar Feb 29 '24 21:02 lehni

With the override file, I get:

docker-compose up
[+] Running 27/27
 ✔ mysql 11 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                              15.3s
   ✔ 20e4dcae4c69 Pull complete                                                                                                                                                       7.2s
   ✔ 1c56c3d4ce74 Pull complete                                                                                                                                                       4.4s
   ✔ e9f03a1c24ce Pull complete                                                                                                                                                       5.6s
   ✔ 68c3898c2015 Pull complete                                                                                                                                                       6.5s
   ✔ 6b95a940e7b6 Pull complete                                                                                                                                                       6.7s
   ✔ 90986bb8de6e Pull complete                                                                                                                                                       6.9s
   ✔ ae71319cb779 Pull complete                                                                                                                                                       8.0s
   ✔ ffc89e9dfd88 Pull complete                                                                                                                                                       7.5s
   ✔ 43d05e938198 Pull complete                                                                                                                                                       9.6s
   ✔ 064b2d298fba Pull complete                                                                                                                                                       8.1s
   ✔ df9a4d85569b Pull complete                                                                                                                                                       8.8s
 ✔ postgres 14 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                        10.0s
   ✔ f546e941f15b Pull complete                                                                                                                                                       1.7s
   ✔ 926c64b890ad Pull complete                                                                                                                                                       0.6s
   ✔ eca757527cc4 Pull complete                                                                                                                                                       0.7s
   ✔ 93d9b27ec7dc Pull complete                                                                                                                                                       1.8s
   ✔ 86e78387c4e9 Pull complete                                                                                                                                                       2.1s
   ✔ 8776625edd8f Pull complete                                                                                                                                                       2.4s
   ✔ d1afcbffdf18 Pull complete                                                                                                                                                       2.3s
   ✔ 6a6c8f936428 Pull complete                                                                                                                                                       2.6s
   ✔ ae47f32f8312 Pull complete                                                                                                                                                       6.4s
   ✔ 82fb85897d06 Pull complete                                                                                                                                                       2.8s
   ✔ ce4a61041646 Pull complete                                                                                                                                                       3.2s
   ✔ ca83cd3ae7cf Pull complete                                                                                                                                                       3.4s
   ✔ f7fbf31fd41d Pull complete                                                                                                                                                       3.9s
   ✔ 353df72b8bf7 Pull complete                                                                                                                                                       4.1s
[+] Building 0.0s (0/0)                                                                                                                                               docker:desktop-linux
[+] Running 3/3
 ✔ Network objection_default     Created                                                                                                                                              0.0s
 ✔ Container objection_postgres  Created                                                                                                                                              0.1s
 ✔ Container objection_mysql     Created                                                                                                                                              0.1s

lehni avatar Feb 29 '24 21:02 lehni

Using image: 'mariadb:lts' instead of image: 'mysql:5' seems to work without the change of arch, btw.

lehni avatar Feb 29 '24 21:02 lehni

@lehni Thanks for the investigation 🙏 What options is the best for you? I wasn't aware of the override option. I'm ok with both options 👌

cesumilo avatar Mar 01 '24 10:03 cesumilo

Let's see how this one behaves: #2619

lehni avatar Mar 03 '24 06:03 lehni

BTW, I am on an ARM system also (M3), but I'm not using docker locally since I already have a mysql and postgresql instance running globally and would have to stop them due to conflicting ports… I just run the tests in those instances, works well.

lehni avatar Mar 03 '24 06:03 lehni