I am trying to create my own docker image containing tensorflow. My Dockerfile looks like this:
FROM python:3.7.9-buster as python-base
RUN apt-get --allow-releaseinfo-change update && apt-get install -y unixodbc-dev
FROM python-base as venv-image
RUN apt-get install -y build-essential g++ tk python-tk python3-tk tk-dev
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN python3 -m pip install --upgrade pip
RUN pip install notebook pandas numpy seaborn
ENV TF_WHEEL_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.7.0-cp37-cp37m-manylinux2010_x86_64.whl
RUN pip install --upgrade $TF_WHEEL_URL
FROM python-base AS app-image
COPY --from=venv-image /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /usr/src/app
RUN chown -R nobody /usr/src/app/
RUN usermod --home /tmp nobody
USER nobody
ENV PYTHONPATH=/usr/src/app
When I try to build the image I get the following error:
$ jbezdek@mac> docker build -t my-image:latest .
[+] Building 65.1s (10/14)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 1.15kB 0.1s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.1s
=> [internal] load metadata for docker.io/library/python:3.7.9-buster 1.3s
=> [python-base 1/2] FROM docker.io/library/python:3.7.9-buster@sha256:83ab4e9e275cb279e5639097aa0780ef82c4fd78622ae36ab35810ab7b57f491 28.5s
=> => resolve docker.io/library/python:3.7.9-buster@sha256:83ab4e9e275cb279e5639097aa0780ef82c4fd78622ae36ab35810ab7b57f491 0.0s
=> => sha256:9e9cd01e30157128ef9b104c9584cde69df1374be10ece82568c94e5b0d6af19 2.22kB / 2.22kB 0.0s
=> => sha256:06af62193c25241eb123af8cf115c7a6298e834976fe148ac79ec11a7ca06ee5 7.69MB / 7.69MB 2.2s
=> => sha256:8b846e1b73901174c506ae5e6219ac2f356ef71eaa5896dfbc238dc67ca4bf73 9.98MB / 9.98MB 1.4s
=> => sha256:83ab4e9e275cb279e5639097aa0780ef82c4fd78622ae36ab35810ab7b57f491 1.86kB / 1.86kB 0.0s
=> => sha256:42bec75914596fe7d61bfda973083109baddab48b6a591c713874c9c66e0978d 9.02kB / 9.02kB 0.0s
=> => sha256:c78c297fb0d010ee085f95ae439636ecb167b050c1acb4273bd576998cf94a83 49.18MB / 49.18MB 12.7s
=> => sha256:fb44d26a138a8d064a4ab8f9b472c64e7136c2482ec5af19bab8811b6d2c15b7 52.17MB / 52.17MB 13.5s
=> => sha256:195488cfc78f0e257698fa052494b5340338b5acfdec4df1b249942044222274 183.89MB / 183.89MB 22.9s
=> => extracting sha256:c78c297fb0d010ee085f95ae439636ecb167b050c1acb4273bd576998cf94a83 1.5s
=> => sha256:e91064730500746be97b6f35ae9c33bf1d9b7b0b4e9fd5f766c84ff08d25502b 6.26MB / 6.26MB 14.4s
=> => sha256:0a78fc05d06f8aba012b30a2db688a3e2e703e317d2ec7e40be76204c670b0a1 15.95MB / 15.95MB 17.0s
=> => sha256:521c43ca96ec8c9641af8aed110859966134fffa21e63748fec100576e252e14 232B / 232B 14.8s
=> => extracting sha256:06af62193c25241eb123af8cf115c7a6298e834976fe148ac79ec11a7ca06ee5 0.2s
=> => extracting sha256:8b846e1b73901174c506ae5e6219ac2f356ef71eaa5896dfbc238dc67ca4bf73 0.2s
=> => sha256:7dafbffb30bdcb6256e239d9b43c57b9522dd79c39d078ce5f0e1b98dc210c2a 2.16MB / 2.16MB 15.7s
=> => extracting sha256:fb44d26a138a8d064a4ab8f9b472c64e7136c2482ec5af19bab8811b6d2c15b7 1.7s
=> => extracting sha256:195488cfc78f0e257698fa052494b5340338b5acfdec4df1b249942044222274 4.3s
=> => extracting sha256:e91064730500746be97b6f35ae9c33bf1d9b7b0b4e9fd5f766c84ff08d25502b 0.2s
=> => extracting sha256:0a78fc05d06f8aba012b30a2db688a3e2e703e317d2ec7e40be76204c670b0a1 0.4s
=> => extracting sha256:521c43ca96ec8c9641af8aed110859966134fffa21e63748fec100576e252e14 0.0s
=> => extracting sha256:7dafbffb30bdcb6256e239d9b43c57b9522dd79c39d078ce5f0e1b98dc210c2a 0.1s
=> [python-base 2/2] RUN apt-get --allow-releaseinfo-change update && apt-get install -y unixodbc-dev 3.2s
=> [venv-image 1/5] RUN apt-get install -y build-essential g++ tk python-tk python3-tk tk-dev 1.2s
=> [venv-image 2/5] RUN python3 -m venv /opt/venv 1.6s
=> [venv-image 3/5] RUN python3 -m pip install --upgrade pip 1.5s
=> [venv-image 4/5] RUN pip install notebook pandas numpy seaborn 27.1s
=> ERROR [venv-image 5/5] RUN pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.7.0-cp37-cp37m-manylinux2010_x86_64.whl 0.4s
------
> [venv-image 5/5] RUN pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.7.0-cp37-cp37m-manylinux2010_x86_64.whl:
#10 0.399 ERROR: tensorflow_cpu-2.7.0-cp37-cp37m-manylinux2010_x86_64.whl is not a supported wheel on this platform.
------
executor failed running [/bin/sh -c pip install --upgrade $TF_WHEEL_URL]: exit code: 1
Honestly, I really don't get it. It says that tensorflow_cpu-2.7.0-cp37-cp37m-manylinux2010_x86_64.whl is not a supported wheel on this platform, but I am using Linux platform (buster is Debian) with Python 3.7 on it, and I am installing the package from an official tensorflow website.
So, what is a problem? What am I missing? Any help is appreciated.
Edit:
This issue is present only on my MacBook Pro (M1, 2020) with MacOS BigSur. When I run the code on MacBook Pro (Intel Core i5, Early 2015) with MacOS Catalina, everything works as expected.