docker icon indicating copy to clipboard operation
docker copied to clipboard

Provide arm64 docker image for running on Apple M1/M2

Open zsvoboda opened this issue 2 years ago • 6 comments

Please provide arm64 docker image for Apple M1/M2.

Thanks

ZD

zsvoboda avatar Aug 03 '22 15:08 zsvoboda

upvote this

xin-hedera avatar Oct 18 '22 15:10 xin-hedera

I've run into this as well while trying to use Citus locally for development.

It looks like the Docker files pull packages from the Debian repository which doesn't have any arm64 artifacts published: packagecloud. I guess we would need to start there, by publish arm64 .debs.

j-white avatar Jul 18 '23 03:07 j-white

I spent some time deciphering the builds and I managed to get an arm64 version of the image up here: https://hub.docker.com/layers/jwhiteatdocker/citus/12.0.0-pg14/images/sha256-caa0ba563dc700428d8c01bd4962cfb5feda61b7958a13a73d8542dba4a90fcd?context=repo

First, I fixed the build_packages command so I could rebuild existing x64 packages: https://github.com/j-white/citus-packaging/commit/45d0a56e594162e1db1301546b8a442d28a15a39

I got them to build on an M1 (arm64): https://github.com/j-white/citus-packaging/commit/d3df9659959c9f47062430cd65983b1eef7feca1

I uploaded the packages to packagecloud: https://packagecloud.io/j-white/citusdata-community-arm64

And then I rebuilt the Docker images: https://github.com/j-white/citus-docker/commit/b040f72d28a554e32618be2444e7819ad6fa1ffc

The result is a multi-arch container for Citus 12.0.0 and PG14:

% docker pull jwhiteatdocker/citus:12.0.0-pg14
...
% docker inspect jwhiteatdocker/citus:12.0.0-pg14 | jq -r '.[] | .Architecture'
arm64
% docker run -d --name "citusdev" -e "POSTGRES_HOST_AUTH_METHOD=trust" -p 5432:5432 jwhiteatdocker/citus:12.0.0-pg14 -c fsync=off
...
% docker exec -it citusdev psql -U postgres
psql (14.8 (Debian 14.8-1.pgdg120+1))
Type "help" for help.

postgres=# CREATE TABLE daily_page_views (
    tenant_id int,
    day date,
    page_id int,
    view_count bigint,
    primary key (tenant_id, day, page_id)
);

SELECT create_distributed_table('daily_page_views', 'tenant_id');
CREATE TABLE
 create_distributed_table 
--------------------------
 
(1 row)

postgres=# 

j-white avatar Jul 20 '23 03:07 j-white

+1

That's an awesome solution but ideally this is part of official image

9mm avatar Jan 15 '24 22:01 9mm