Skip to content

Docker-compose up failed on mac m1 BigSur #13

@arenouf14

Description

@arenouf14

Run into a problem on TA-lib and h5py install while running docker-compose up on a mac M1.
Error:
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && tar -xvzf ta-lib-0.4.0-src.tar.gz && cd ta-lib/ && ./configure --prefix=/usr && make && make install]: exit code: 1

Seems the problem comes from the architecture that is used by default when running from mac m1.
Solved by adding explicitly the platform in the Dockerfile (first line):
FROM --platform=linux/amd64 python:3.8
But have a warning explaining I ll have poor performances.

I tried FROM --platform=linux/arm64 python:3.8 and it works with good performances but I removed h5py because of a similar error appearing (I think I need to install from source for this library probably but will do it if I need).

---- GIT DIFF

diff --git a/Dockerfile b/Dockerfile
index 7c75123..5c6d041 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,12 @@
-FROM python:3.8
+FROM --platform=linux/arm64 python:3.8

-MAINTAINER Part Time Larry "parttimelarry@gmail.com"
+MAINTAINER cryptonouf "cryptonouf@protonmail.com"

 ADD . /app

 WORKDIR /app

-RUN apt-get update && apt-get install -y build-essential redis-server sqlite3 \
+RUN apt-get update && apt-get install -y build-essential automake redis-server sqlite3 \
     curl software-properties-common

 # install nodejs and wscat websocket client
@@ -18,6 +18,7 @@ RUN apt-get install -y nodejs && npm install wscat
 RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
   tar -xvzf ta-lib-0.4.0-src.tar.gz && \
   cd ta-lib/ && \
+  cp /usr/share/automake-1.16/config.guess . && \
   ./configure --prefix=/usr && \
   make && \
   make install
diff --git a/requirements.txt b/requirements.txt
index 08ae490..e02df4f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -72,7 +72,7 @@ websockets

 # other data stores, formats
 redis
-h5py
+#h5py

 # utilities
 beautifulsoup4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions