From 1f9ebeb3292e1415ca39f48553f1a52f4a1097f2 Mon Sep 17 00:00:00 2001 From: "Che-Wei (Allen) Chang" <58289693+allen3325@users.noreply.github.com> Date: Tue, 3 Oct 2023 19:12:58 +0800 Subject: [PATCH] add: Create cu11.8-py310-torch2.0.1-tensorflow2.14.0-jupyterlab-vscode.Dockerfile add have tensorflow image. --- ...sorflow2.14.0-jupyterlab-vscode.Dockerfile | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 image/cu11.8-py310-torch2.0.1-tensorflow2.14.0-jupyterlab-vscode.Dockerfile diff --git a/image/cu11.8-py310-torch2.0.1-tensorflow2.14.0-jupyterlab-vscode.Dockerfile b/image/cu11.8-py310-torch2.0.1-tensorflow2.14.0-jupyterlab-vscode.Dockerfile new file mode 100644 index 0000000..13db0d3 --- /dev/null +++ b/image/cu11.8-py310-torch2.0.1-tensorflow2.14.0-jupyterlab-vscode.Dockerfile @@ -0,0 +1,99 @@ +FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 + +RUN apt update && \ + apt install -y \ + wget build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev \ + libreadline-dev libffi-dev libsqlite3-dev libbz2-dev liblzma-dev && \ + apt clean && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /temp + +# download python +RUN wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz && \ + tar -xvf Python-3.10.12.tgz + +# install python +RUN cd Python-3.10.12 && \ + ./configure --enable-optimizations && \ + make && \ + make install + +WORKDIR /workspace + +RUN rm -r /temp && \ + ln -s /usr/local/bin/python3 /usr/local/bin/python && \ + ln -s /usr/local/bin/pip3 /usr/local/bin/pip + +# install pytorch +RUN pip3 install torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118 && \ + rm -r /root/.cache/pip + +# install tensorflow +RUN pip3 install --upgrade pip \ + pip install tensorflow==2.14.0 + +# +WORKDIR / + +ARG DEBIAN_FRONTEND=noninteractive + +# +RUN apt-get update && apt-get install -y sudo \ + apt-utils \ + wget \ + vim \ + git \ + curl + +# ip、ping +RUN apt-get install -y net-tools \ + iputils-ping + +# ssh +RUN apt-get install -y openssh-server +RUN apt-get install -y wget +COPY config_files/ssh_config /etc/ssh/ssh_config +RUN service ssh restart + +# fail2ban +RUN apt-get install -y fail2ban +COPY config_files/jail.conf /etc/fail2ban/jail.conf +RUN service fail2ban restart + +# script for create user +COPY script_files/docker_start.sh /docker_start.sh +RUN chmod 777 /docker_start.sh + +# jupyter +COPY config_files/jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py +RUN pip install jupyterlab + +# avoid scp error +RUN rm /etc/bash.bashrc +RUN touch /etc/bash.bashrc + +# utf-8 zh_TW +RUN apt-get install -y locales +RUN locale-gen en_US.utf8 +RUN echo 'export LANGUAGE="en_US.utf8"' >> /etc/bash.bashrc +RUN echo 'export LANG="en_US.utf8"' >> /etc/bash.bashrc +RUN echo 'export LC_ALL="en_US.utf8"' >> /etc/bash.bashrc +RUN update-locale LANG=en_US.utf8 + +# nodejs +RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - +RUN sudo apt install nodejs + +# vscode-server +RUN npm install -g yarn +RUN curl -fsSL https://code-server.dev/install.sh | sh +ENV SHELL=/bin/bash + +# +EXPOSE 22 +EXPOSE 8888 +EXPOSE 8080 + +# +ENTRYPOINT /docker_start.sh && /bin/bash