Skip to content

Instantly share code, notes, and snippets.

@chand1012
Created July 15, 2021 02:21
Show Gist options
  • Save chand1012/f76771604702b033c625fbce4d4514dd to your computer and use it in GitHub Desktop.
Save chand1012/f76771604702b033c625fbce4d4514dd to your computer and use it in GitHub Desktop.
An ARM64 Dockerfile for Tensorflow.
[ -z "$PS1" ] && return
export PS1="\[\e[31m\]tf-docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > "
export TERM=xterm-256color
alias grep="grep --color=auto"
alias ls="ls --color=auto"
echo -e "\e[m"
# Based on https://tinyurl.com/22reyw2h
ARG UBUNTU_VERSION=18.04
FROM ubuntu:${UBUNTU_VERSION} as base
RUN apt-get update && apt-get install -y curl
# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
libhdf5-dev \
libhdf5-100 \
pkg-config
RUN python3 -m pip --no-cache-dir install --upgrade \
"pip<20.3" \
setuptools
# Some TF tools expect a "python" binary
RUN ln -s $(which python3) /usr/local/bin/python
# see why you need this line here: https://tinyurl.com/2bdssxxr
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
ADD ["https://snapshots.linaro.org/ldcg/python/tensorflow-manylinux/11/tensorflow-cpu/tensorflow_cpu-2.5.0-cp36-cp36m-manylinux2014_aarch64.whl", "/tensorflow_cpu-2.5.0-cp36-cp36m-manylinux2014_aarch64.whl"]
RUN python3 -m pip install --no-cache-dir /tensorflow_cpu-2.5.0-cp36-cp36m-manylinux2014_aarch64.whl
RUN rm /tensorflow_cpu-2.5.0-cp36-cp36m-manylinux2014_aarch64.whl
COPY bashrc /etc/bash.bashrc
RUN chmod a+rwx /etc/bash.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment