timescale / timescaledb-docker-ha

Create Docker images containing TimescaleDB, Patroni to be used by developers and Kubernetes.
Apache License 2.0
155 stars 44 forks source link

Docker image no longer working on ARM macs #419

Closed ollz272 closed 7 months ago

ollz272 commented 1 year ago

``Hi,

Previously the docker image we had was able to build on macs, using: timescale/timescaledb-ha:pg15.2-ts2.10.1-latest

However since updating to: FROM timescale/timescaledb-ha:pg15.3-ts2.11.1-all

We can no longer build on mac:

(timescale-models-py3.11) oliver@GE-14001 timescale_models % docker build .
[+] Building 0.9s (3/3) FINISHED                                                                                                                  docker:desktop-linux
 => [internal] load .dockerignore                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                   0.0s
 => [internal] load build definition from Dockerfile                                                                                                              0.0s
 => => transferring dockerfile: 502B                                                                                                                              0.0s
 => ERROR [internal] load metadata for docker.io/timescale/timescaledb-ha:pg15.3-ts2.11.1                                                                         0.8s
------
 > [internal] load metadata for docker.io/timescale/timescaledb-ha:pg15.3-ts2.11.1:
------
Dockerfile:1
--------------------
   1 | >>> FROM timescale/timescaledb-ha:pg15.3-ts2.11.1
   2 |     # migrations.sql needs to be generated via alembic and should contain the
   3 |     # full migration history to populate the database schema from blank. This
--------------------
ERROR: failed to solve: timescale/timescaledb-ha:pg15.3-ts2.11.1: no match for platform in manifest sha256:5e99dc714b44b71a594bd2e8d1ab6e1d4cdf8df2f5693864cd412c3126ddd4a1: not found
(timescale-models-py3.11) oliver@GE-14001 timescale_models % docker build --platform linux/arm64  .
[+] Building 1.1s (3/3) FINISHED                                                                                                                  docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                              0.0s
 => => transferring dockerfile: 502B                                                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                   0.0s
 => ERROR [internal] load metadata for docker.io/timescale/timescaledb-ha:pg15.3-ts2.11.1                                                                         1.0s
------
 > [internal] load metadata for docker.io/timescale/timescaledb-ha:pg15.3-ts2.11.1:
------
Dockerfile:1
--------------------
   1 | >>> FROM timescale/timescaledb-ha:pg15.3-ts2.11.1
   2 |     # migrations.sql needs to be generated via alembic and should contain the
   3 |     # full migration history to populate the database schema from blank. This
--------------------
ERROR: failed to solve: timescale/timescaledb-ha:pg15.3-ts2.11.1: no match for platform in manifest sha256:5e99dc714b44b71a594bd2e8d1ab6e1d4cdf8df2f5693864cd412c3126ddd4a1: not found
graveland commented 1 year ago

I'd be surprised if this ever worked the way you describe it? timescaledb-docker-ha has never built official arm64 images, so your FROM statement would always have broken if you were specifying --platform linux/arm64. If you were building under emulation with --platform linux/amd64, then it would've worked a while ago. To fix building under emulation, alter your FROM statement to include -arm64 in the tag, ie. pg15.3-ts2.11.1-amd64.