supabase / pg_jsonschema

PostgreSQL extension providing JSON Schema validation
Apache License 2.0
1.03k stars 30 forks source link

docker compose up doesn't work on silicon macs? #39

Closed craigpastro closed 2 weeks ago

craigpastro commented 1 year ago

Bug report

Describe the bug

I am on a silicon mac (M2 Pro) and docker compose up just hangs as below. It works fine on intel macs however. Any ideas? And thanks for any help!

$ docker compose up
[+] Building 248.1s (13/17)                                                                                   docker:desktop-linux
 => [db internal] load build definition from Dockerfile                                                                       0.0s
 => => transferring dockerfile: 1.02kB                                                                                        0.0s
 => [db internal] load .dockerignore                                                                                          0.0s
 => => transferring context: 162B                                                                                             0.0s
 => [db internal] load metadata for docker.io/library/postgres:14                                                             1.6s
 => [db  1/13] FROM docker.io/library/postgres:14@sha256:b2f06ce12103bedbc0a49ae4ffff062d90824e0f45462de712f66952679f7670     3.5s
 => => resolve docker.io/library/postgres:14@sha256:b2f06ce12103bedbc0a49ae4ffff062d90824e0f45462de712f66952679f7670          0.0s
 => => sha256:e71d5c9dd884de4fc1ea74a91d970c0ad8e23c5cd783b26c4d3d206e61f37c8d 9.53kB / 9.53kB                                0.2s
 => => sha256:b2f06ce12103bedbc0a49ae4ffff062d90824e0f45462de712f66952679f7670 1.86kB / 1.86kB                                0.0s
 => => sha256:eb673d59ff2019c9059e196d384e84d7c39de6cc50c999d94dfc28de5a242ab9 10.42kB / 10.42kB                              0.0s
 => => sha256:38e7c1f051cc1287b84acd017ea088b822199cb70f658c51e27ec607e91f2e12 101.37MB / 101.37MB                            1.5s
 => => sha256:1d40741fbab766d525291f068923b7bab6658bd25918a8aa07e75aee9deab70f 3.04kB / 3.04kB                                0.0s
 => => sha256:4d0e2800e837e04d62cf1b3b34b06fe6bdb1b091e2d52ef48cb976b5211df4cc 129B / 129B                                    0.2s
 => => sha256:09a5999e7ba9e244249b9fd56301d240e04a0f9f1fd8b3c6c6c334d0ef0e7ef0 4.78kB / 4.78kB                                0.3s
 => => sha256:98904cb8f55dd3b2009ae89b4e7dfb92ace4cf8b3ac86a9b0fac2db00cfe7a17 199B / 199B                                    0.3s
 => => extracting sha256:38e7c1f051cc1287b84acd017ea088b822199cb70f658c51e27ec607e91f2e12                                     1.7s
 => => extracting sha256:e71d5c9dd884de4fc1ea74a91d970c0ad8e23c5cd783b26c4d3d206e61f37c8d                                     0.0s
 => => extracting sha256:4d0e2800e837e04d62cf1b3b34b06fe6bdb1b091e2d52ef48cb976b5211df4cc                                     0.0s
 => => extracting sha256:98904cb8f55dd3b2009ae89b4e7dfb92ace4cf8b3ac86a9b0fac2db00cfe7a17                                     0.0s
 => => extracting sha256:09a5999e7ba9e244249b9fd56301d240e04a0f9f1fd8b3c6c6c334d0ef0e7ef0                                     0.0s
 => [db internal] load build context                                                                                          0.0s
 => => transferring context: 64.12kB                                                                                          0.0s
 => [db  2/13] RUN apt-get update                                                                                             1.7s
 => [db  3/13] RUN apt-get install -y --no-install-recommends ca-certificates   git   build-essential   libpq-dev   postgre  14.9s
 => [db  4/13] WORKDIR /home/supa                                                                                             0.0s
 => [db  5/13] RUN chown postgres:postgres /home/supa                                                                         0.3s
 => [db  6/13] RUN   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile min  13.0s
 => [db  7/13] RUN cargo install cargo-pgrx --version 0.10.1 --locked                                                        75.3s
 => [db  8/13] RUN cargo pgrx init --pg14 $(which pg_config)                                                                  1.1s
 => [db  9/13] COPY . .                                                                                                       0.0s
 => [db 10/13] RUN cargo pgrx install                                                                                       136.7s
 => => #    Compiling bytecount v0.6.3
 => => #    Compiling base64 v0.13.1
 => => #    Compiling seq-macro v0.3.5
 => => #    Compiling seahash v4.1.0
 => => #    Compiling jsonschema v0.16.1
 => => #    Compiling pgrx v0.10.1
failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF

To Reproduce

Run docker compose up on a silicon mac.

Expected behavior

Runs Postgres with the pg_jsonschema extension installed.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

Additional context

Add any other context about the problem here.

imor commented 1 year ago

Which docker version are you on? It works for me on the following version:

➜ docker -v
Docker version 24.0.5, build ced0996
craigpastro commented 1 year ago

Which docker version are you on? It works for me on the following version:

Oh, very good question. Thank you.

$ docker -v
Docker version 24.0.6, build ed223bc

I've also updated the issue.

Perhaps I need to try reinstalling docker. I'll report back.

Edit: I've reinstalled docker, blew away .docker, and it still doesn't work 😢

sughodke commented 2 weeks ago

Works for me as well

% docker --version
Docker version 27.3.1, build ce12230

% sw_vers -productVersion 
14.6.1

% sysctl -a | grep machdep.cpu 
machdep.cpu.cores_per_package: 8
machdep.cpu.core_count: 8
machdep.cpu.logical_per_package: 8
machdep.cpu.thread_count: 8
machdep.cpu.brand_string: Apple M2
craigpastro commented 2 weeks ago

Oh, that's great! I no longer have a silicon Mac, so I can't test it. I'll close the issue as it seems to be a me problem. Thanks!