ARG RELEASE |
ARG LAUNCHPAD_BUILD_ARCH |
LABEL org.opencontainers.image.ref.name=ubuntu |
LABEL org.opencontainers.image.version=20.04 |
ADD file:4809da414c2d478b4d991cbdaa2df457f2b3d07d0ff6cf673f09a66f90833e81 in / |
CMD ["/bin/bash"] |
ENV NVARCH=x86_64 |
ENV NVIDIA_REQUIRE_CUDA=cuda>=11.2 brand=tesla,driver>=418,driver<419 brand=tesla,driver>=450,driver<451 |
ENV NV_CUDA_CUDART_VERSION=11.2.152-1 |
ENV NV_CUDA_COMPAT_PACKAGE=cuda-compat-11-2 |
ARG TARGETARCH |
LABEL maintainer=NVIDIA CORPORATION <cudatools@nvidia.com> |
RUN |1 TARGETARCH=amd64 /bin/sh -c apt-get update && apt-get install -y --no-install-recommends gnupg2 curl ca-certificates && curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/${NVARCH}/3bf863cc.pub | apt-key add - && echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/${NVARCH} /" > /etc/apt/sources.list.d/cuda.list && apt-get purge --autoremove -y curl && rm -rf /var/lib/apt/lists/* # buildkit |
ENV CUDA_VERSION=11.2.2 |
RUN |1 TARGETARCH=amd64 /bin/sh -c apt-get update && apt-get install -y --no-install-recommends cuda-cudart-11-2=${NV_CUDA_CUDART_VERSION} ${NV_CUDA_COMPAT_PACKAGE} && ln -s cuda-11.2 /usr/local/cuda && rm -rf /var/lib/apt/lists/* # buildkit |
RUN |1 TARGETARCH=amd64 /bin/sh -c echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf # buildkit |
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 |
COPY NGC-DL-CONTAINER-LICENSE / # buildkit |
ENV NVIDIA_VISIBLE_DEVICES=all |
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility |
ENV NV_CUDA_LIB_VERSION=11.2.2-1 |
ENV NV_NVTX_VERSION=11.2.152-1 |
ENV NV_LIBNPP_VERSION=11.3.2.152-1 |
ENV NV_LIBNPP_PACKAGE=libnpp-11-2=11.3.2.152-1 |
ENV NV_LIBCUSPARSE_VERSION=11.4.1.1152-1 |
ENV NV_LIBCUBLAS_PACKAGE_NAME=libcublas-11-2 |
ENV NV_LIBCUBLAS_VERSION=11.4.1.1043-1 |
ENV NV_LIBCUBLAS_PACKAGE=libcublas-11-2=11.4.1.1043-1 |
ENV NV_LIBNCCL_PACKAGE_NAME=libnccl2 |
ENV NV_LIBNCCL_PACKAGE_VERSION=2.8.4-1 |
ENV NCCL_VERSION=2.8.4-1 |
ENV NV_LIBNCCL_PACKAGE=libnccl2=2.8.4-1+cuda11.2 |
ARG TARGETARCH |
LABEL maintainer=NVIDIA CORPORATION <cudatools@nvidia.com> |
RUN |1 TARGETARCH=amd64 /bin/sh -c apt-get update && apt-get install -y --no-install-recommends cuda-libraries-11-2=${NV_CUDA_LIB_VERSION} ${NV_LIBNPP_PACKAGE} cuda-nvtx-11-2=${NV_NVTX_VERSION} libcusparse-11-2=${NV_LIBCUSPARSE_VERSION} ${NV_LIBCUBLAS_PACKAGE} ${NV_LIBNCCL_PACKAGE} && rm -rf /var/lib/apt/lists/* # buildkit |
RUN |1 TARGETARCH=amd64 /bin/sh -c apt-mark hold ${NV_LIBCUBLAS_PACKAGE_NAME} ${NV_LIBNCCL_PACKAGE_NAME} # buildkit |
COPY entrypoint.d/ /opt/nvidia/entrypoint.d/ # buildkit |
COPY nvidia_entrypoint.sh /opt/nvidia/ # buildkit |
ENV NVIDIA_PRODUCT_NAME=CUDA |
ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] |
ENV NV_CUDA_LIB_VERSION=11.2.2-1 |
ENV NV_CUDA_CUDART_DEV_VERSION=11.2.152-1 |
ENV NV_NVML_DEV_VERSION=11.2.152-1 |
ENV NV_LIBCUSPARSE_DEV_VERSION=11.4.1.1152-1 |
ENV NV_LIBNPP_DEV_VERSION=11.3.2.152-1 |
ENV NV_LIBNPP_DEV_PACKAGE=libnpp-dev-11-2=11.3.2.152-1 |
ENV NV_LIBCUBLAS_DEV_VERSION=11.4.1.1043-1 |
ENV NV_LIBCUBLAS_DEV_PACKAGE_NAME=libcublas-dev-11-2 |
ENV NV_LIBCUBLAS_DEV_PACKAGE=libcublas-dev-11-2=11.4.1.1043-1 |
ENV NV_CUDA_NSIGHT_COMPUTE_VERSION=11.2.2-1 |
ENV NV_CUDA_NSIGHT_COMPUTE_DEV_PACKAGE=cuda-nsight-compute-11-2=11.2.2-1 |
ENV NV_NVPROF_VERSION=11.2.152-1 |
ENV NV_NVPROF_DEV_PACKAGE=cuda-nvprof-11-2=11.2.152-1 |
ENV NV_LIBNCCL_DEV_PACKAGE_NAME=libnccl-dev |
ENV NV_LIBNCCL_DEV_PACKAGE_VERSION=2.8.4-1 |
ENV NCCL_VERSION=2.8.4-1 |
ENV NV_LIBNCCL_DEV_PACKAGE=libnccl-dev=2.8.4-1+cuda11.2 |
ARG TARGETARCH |
LABEL maintainer=NVIDIA CORPORATION <cudatools@nvidia.com> |
RUN |1 TARGETARCH=amd64 /bin/sh -c apt-get update && apt-get install -y --no-install-recommends libtinfo5 libncursesw5 cuda-cudart-dev-11-2=${NV_CUDA_CUDART_DEV_VERSION} cuda-command-line-tools-11-2=${NV_CUDA_LIB_VERSION} cuda-minimal-build-11-2=${NV_CUDA_LIB_VERSION} cuda-libraries-dev-11-2=${NV_CUDA_LIB_VERSION} cuda-nvml-dev-11-2=${NV_NVML_DEV_VERSION} ${NV_NVPROF_DEV_PACKAGE} ${NV_LIBNPP_DEV_PACKAGE} libcusparse-dev-11-2=${NV_LIBCUSPARSE_DEV_VERSION} ${NV_LIBCUBLAS_DEV_PACKAGE} ${NV_LIBNCCL_DEV_PACKAGE} ${NV_CUDA_NSIGHT_COMPUTE_DEV_PACKAGE} && rm -rf /var/lib/apt/lists/* # buildkit |
RUN |1 TARGETARCH=amd64 /bin/sh -c apt-mark hold ${NV_LIBCUBLAS_DEV_PACKAGE_NAME} ${NV_LIBNCCL_DEV_PACKAGE_NAME} # buildkit |
ENV LIBRARY_PATH=/usr/local/cuda/lib64/stubs |
ENV ARGOS_DEVICE_TYPE=cuda |
ARG with_models=false |
ARG models= |
WORKDIR /app |
ARG DEBIAN_FRONTEND=noninteractive |
RUN |3 with_models=false models= DEBIAN_FRONTEND=noninteractive /bin/sh -c apt-get update -qq && apt-get -qqq install --no-install-recommends -y libicu-dev libaspell-dev libcairo2 libcairo2-dev pkg-config gcc g++ python3.8-dev python3-pip libpython3.8-dev && apt-get upgrade --assume-yes && apt-get clean && rm -rf /var/lib/apt # buildkit |
RUN |3 with_models=false models= DEBIAN_FRONTEND=noninteractive /bin/sh -c pip3 install --no-cache-dir --upgrade pip && apt-get remove python3-pip --assume-yes # buildkit |
RUN |3 with_models=false models= DEBIAN_FRONTEND=noninteractive /bin/sh -c ln -s /usr/bin/python3 /usr/bin/python # buildkit |
RUN |3 with_models=false models= DEBIAN_FRONTEND=noninteractive /bin/sh -c pip3 install --no-cache-dir torch==1.12.0+cu116 -f https://download.pytorch.org/whl/torch_stable.html # buildkit |
COPY . . # buildkit |
RUN |3 with_models=false models= DEBIAN_FRONTEND=noninteractive /bin/sh -c if [ "$with_models" = "true" ]; then pip3 install --no-cache-dir -e .; if [ ! -z "$models" ]; then ./scripts/install_models.py --load_only_lang_codes "$models"; else ./scripts/install_models.py; fi fi # buildkit |
RUN |3 with_models=false models= DEBIAN_FRONTEND=noninteractive /bin/sh -c pip3 install Babel==2.12.1 && python3 scripts/compile_locales.py && pip3 install . && pip3 cache purge # buildkit |
EXPOSE map[5000/tcp:{}] |
ENTRYPOINT ["libretranslate" "--host" "0.0.0.0"] |