fix dockerfile

This commit is contained in:
pengluan 2021-11-10 10:54:45 +08:00
parent 37f2e43dae
commit be7c8a5a7b
3 changed files with 35 additions and 23 deletions

View File

@ -1,32 +1,43 @@
set -ex
hubhost=ai.tencentmusic.com/tme-public
base_image=nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04
base_image=nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
docker build -t $hubhost/ubuntu-gpu:cuda10.1-cudnn7 --build-arg FROM_IMAGES=$base_image -f cuda/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.1-cudnn7-python3.6 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.1-cudnn7 --build-arg PYTHON_VERSION=python3.6 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.1-cudnn7-python3.7 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.1-cudnn7 --build-arg PYTHON_VERSION=python3.7 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.1-cudnn7-python3.6 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.1-cudnn7 --build-arg PYTHON_VERSION=python3.6 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.1-cudnn7-python3.7 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.1-cudnn7 --build-arg PYTHON_VERSION=python3.7 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.1-cudnn7-python3.8 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.1-cudnn7 --build-arg PYTHON_VERSION=python3.8 -f cuda/python/Dockerfile .
docker push $hubhost/ubuntu-gpu:cuda10.1-cudnn7
docker push $hubhost/ubuntu-gpu:cuda10.1-cudnn7-python3.6
docker push $hubhost/ubuntu-gpu:cuda10.1-cudnn7-python3.7
docker push $hubhost/ubuntu-gpu:cuda10.1-cudnn7-python3.8
base_image=nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04
base_image=nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
docker build -t $hubhost/ubuntu-gpu:cuda10.0-cudnn7 --build-arg FROM_IMAGES=$base_image -f cuda/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.0-cudnn7-python3.6 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.0-cudnn7 --build-arg PYTHON_VERSION=python3.6 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.0-cudnn7-python3.7 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.0-cudnn7 --build-arg PYTHON_VERSION=python3.7 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.0-cudnn7-python3.6 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.0-cudnn7 --build-arg PYTHON_VERSION=python3.6 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.0-cudnn7-python3.7 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.0-cudnn7 --build-arg PYTHON_VERSION=python3.7 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda10.0-cudnn7-python3.8 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda10.0-cudnn7 --build-arg PYTHON_VERSION=python3.8 -f cuda/python/Dockerfile .
docker push $hubhost/ubuntu-gpu:cuda10.0-cudnn7
docker push $hubhost/ubuntu-gpu:cuda10.0-cudnn7-python3.6
docker push $hubhost/ubuntu-gpu:cuda10.0-cudnn7-python3.7
docker push $hubhost/ubuntu-gpu:cuda10.0-cudnn7-python3.8
base_image=nvidia/cuda:9.1-cudnn7-runtime-ubuntu16.04
base_image=nvidia/cuda:9.1-cudnn7-devel-ubuntu16.04
docker build -t $hubhost/ubuntu-gpu:cuda9.1-cudnn7 --build-arg FROM_IMAGES=$base_image -f cuda/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.1-cudnn7-python3.6 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.1-cudnn7 --build-arg PYTHON_VERSION=python3.6 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.1-cudnn7-python3.7 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.1-cudnn7 --build-arg PYTHON_VERSION=python3.7 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.1-cudnn7-python3.6 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.1-cudnn7 --build-arg PYTHON_VERSION=python3.6 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.1-cudnn7-python3.7 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.1-cudnn7 --build-arg PYTHON_VERSION=python3.7 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.1-cudnn7-python3.8 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.1-cudnn7 --build-arg PYTHON_VERSION=python3.8 -f cuda/python/Dockerfile .
docker push $hubhost/ubuntu-gpu:cuda9.1-cudnn7
docker push $hubhost/ubuntu-gpu:cuda9.1-cudnn7-python3.6
docker push $hubhost/ubuntu-gpu:cuda9.1-cudnn7-python3.7
docker push $hubhost/ubuntu-gpu:cuda9.1-cudnn7-python3.8
base_image=nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
base_image=nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
docker build -t $hubhost/ubuntu-gpu:cuda9.0-cudnn7 --build-arg FROM_IMAGES=$base_image -f cuda/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.0-cudnn7-python3.6 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.0-cudnn7 --build-arg PYTHON_VERSION=python3.6 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.0-cudnn7-python3.7 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.0-cudnn7 --build-arg PYTHON_VERSION=python3.7 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.0-cudnn7-python3.6 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.0-cudnn7 --build-arg PYTHON_VERSION=python3.6 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.0-cudnn7-python3.7 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.0-cudnn7 --build-arg PYTHON_VERSION=python3.7 -f cuda/python/Dockerfile .
docker build -t $hubhost/ubuntu-gpu:cuda9.0-cudnn7-python3.8 --build-arg FROM_IMAGES=$hubhost/ubuntu-gpu:cuda9.0-cudnn7 --build-arg PYTHON_VERSION=python3.8 -f cuda/python/Dockerfile .
docker push $hubhost/ubuntu-gpu:cuda9.0-cudnn7
docker push $hubhost/ubuntu-gpu:cuda9.0-cudnn7-python3.6
docker push $hubhost/ubuntu-gpu:cuda9.0-cudnn7-python3.7
docker push $hubhost/ubuntu-gpu:cuda9.0-cudnn7-python3.8

View File

@ -1,5 +1,3 @@
ARG FROM_IMAGES
FROM $FROM_IMAGES

View File

@ -1,11 +1,14 @@
ARG FROM_IMAGES
FROM ${FROM_IMAGES}
ARG PYTHON_VERSION
FROM $FROM_IMAGES
# 安装python
RUN add-apt-repository -y ppa:deadsnakes/ppa && apt update && apt install -y $PYTHON_VERSION libsasl2-dev libpq-dev python3-pip python3-distutils \
&& rm -rf /usr/bin/python && ln -s /usr/bin/$PYTHON_VERSION /usr/bin/python
RUN add-apt-repository -y ppa:deadsnakes/ppa && apt update && apt install -y libsasl2-dev libpq-dev python3-pip python3-distutils
RUN set -x; apt install -y ${PYTHON_VERSION} && rm -rf /usr/bin/python && ln -s /usr/bin/${PYTHON_VERSION} /usr/bin/python
RUN bash -c "wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py --ignore-installed" \
&& rm -rf /usr/bin/pip && ln -s /usr/bin/pip3 /usr/bin/pip
RUN pip install --upgrade pip && pip install flask requests kubernetes numpy pandas tornado pysnooper