josephmachado / analytical_dp_with_sql

Code for my "Efficient Data Processing in SQL" book.
https://josephmachado.gumroad.com/l/analyticalsql
49 stars 17 forks source link

[Docker] Unable to setup Docker containers in Macbook pro m1 #4

Open josephmachado opened 1 year ago

josephmachado commented 1 year ago

Describe the bug I have a macbook pro m1 pro and when i am trying to follow the setup instructions for I keep getting the following message when i do make up for invoking docker container. Please help:

To Reproduce Steps to reproduce the behavior:

  1. Run make up on a Macbook pro m1

Expected behavior All the required containers must spin up.

Screenshots

Screenshot 2023-02-11 at 1 41 23 PM

Desktop (please complete the following information):

josephmachado commented 1 year ago

If you are running this in Macbook M1, please replace this line https://github.com/josephmachado/analytical_dp_with_sql/blob/9be57b1dedcfa0ecbd8b9843cc19652342f44d7a/docker-compose.yml#L29 with image: 'ghcr.io/bitsondatadev/hive-metastore:latest@sha256:5b633299a2b1136d3e8b22d26a38a246534144f87baa4f2a906b929d5cf68b63'

danieltomasz commented 1 year ago

Hi I just wrote email, probably about this issue; Would be better/more reproducible to have 2 docker compose and concatenate them when running on m1 - this could be separate command in makefile

docker-compose -f docker-compose.yml -f docker-compose2.yml up
josephmachado commented 1 year ago

TY, That's a really good point @danieltomasz from a usability perspective. I will re-open this issue and figure out a way to have a single command for both intel and m1 mac processors.

danieltomasz commented 1 year ago

uname -m should give info about platform, then maybe conditional in the makefile command might be used https://www.gnu.org/software/make/manual/html_node/Conditional-Example.html

then maybe separate yaml but only with the part that are OS dependent; concating yaml with macos specifig config should override the previous params https://docs.docker.com/compose/compose-file/13-merge/case