diff --git a/Dockerfile b/Dockerfile index 59ca86f7..322b8b2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,17 +5,24 @@ FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 # >> START Install base software +RUN apt-get update && apt-get install -y \ + software-properties-common \ + curl + +RUN add-apt-repository ppa:git-core/ppa && \ + curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash + # Get basic packages RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ curl \ wget \ git \ - python \ - python-dev \ - python-pip \ - python-wheel \ - python-numpy \ + python3 \ + python3-dev \ + python3-pip \ + python3-wheel \ + python3-numpy \ libcurl3-dev \ ca-certificates \ gcc \ @@ -35,7 +42,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ openjdk-8-jdk \ bash-completion \ g++ \ - unzip + unzip \ + git-lfs + +RUN ln -s -f /usr/bin/python3 /usr/bin/python # Install NCCL 2.2 RUN apt-get install -qq -y --allow-downgrades --allow-change-held-packages libnccl2=2.3.7-1+cuda10.0 libnccl-dev=2.3.7-1+cuda10.0 @@ -49,7 +59,7 @@ RUN apt-get install -qq -y cuda-command-line-tools-10-0 # Install pip RUN wget https://bootstrap.pypa.io/get-pip.py && \ - python get-pip.py && \ + python3 get-pip.py && \ rm get-pip.py # << END Install base software @@ -80,7 +90,7 @@ ENV TF_BUILD_CONTAINER_TYPE GPU ENV TF_BUILD_OPTIONS OPT ENV TF_BUILD_DISABLE_GCP 1 ENV TF_BUILD_ENABLE_XLA 0 -ENV TF_BUILD_PYTHON_VERSION PYTHON2 +ENV TF_BUILD_PYTHON_VERSION PYTHON3 ENV TF_BUILD_IS_OPT OPT ENV TF_BUILD_IS_PIP PIP @@ -101,8 +111,8 @@ ENV TF_NEED_TENSORRT 0 ENV TF_NEED_GDR 0 ENV TF_NEED_VERBS 0 ENV TF_NEED_OPENCL_SYCL 0 -ENV PYTHON_BIN_PATH /usr/bin/python2.7 -ENV PYTHON_LIB_PATH /usr/lib/python2.7/dist-packages +ENV PYTHON_BIN_PATH /usr/bin/python3.6 +ENV PYTHON_LIB_PATH /usr/lib/python3.6/dist-packages # << END Configure Tensorflow Build @@ -134,14 +144,15 @@ ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64:/usr/loc # << END Configure Bazel - - # Copy DeepSpeech repo contents to container's /DeepSpeech COPY . /DeepSpeech/ +# Alternative clone from GitHub +# WORKDIR / +# RUN git clone https://github.com/mozilla/DeepSpeech.git WORKDIR /DeepSpeech -RUN pip --no-cache-dir install -r requirements.txt +RUN pip3 --no-cache-dir install -r requirements.txt # Link DeepSpeech native_client libs to tf folder RUN ln -s /DeepSpeech/native_client /tensorflow @@ -176,7 +187,7 @@ RUN bazel build --config=monolithic --config=cuda -c opt --copt=-O3 --copt="-D_G # RUN bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg # # # Install tensorflow from our custom wheel -# RUN pip install /tmp/tensorflow_pkg/*.whl +# RUN pip3 install /tmp/tensorflow_pkg/*.whl # Copy built libs to /DeepSpeech/native_client RUN cp /tensorflow/bazel-bin/native_client/generate_trie /DeepSpeech/native_client/ \ @@ -184,7 +195,7 @@ RUN cp /tensorflow/bazel-bin/native_client/generate_trie /DeepSpeech/native_clie # Install TensorFlow WORKDIR /DeepSpeech/ -RUN pip install tensorflow-gpu==1.13.1 +RUN pip3 install tensorflow-gpu==1.13.1 # Make DeepSpeech and install Python bindings @@ -193,10 +204,10 @@ WORKDIR /DeepSpeech/native_client RUN make deepspeech WORKDIR /DeepSpeech/native_client/python RUN make bindings -RUN pip install dist/deepspeech* +RUN pip3 install dist/deepspeech* WORKDIR /DeepSpeech/native_client/ctcdecode RUN make -RUN pip install dist/*.whl +RUN pip3 install dist/*.whl # << END Build and bind