-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: Create cu11.8-py310-torch2.0.1-tensorflow2.14.0-jupyterlab-vscod…
…e.Dockerfile add have tensorflow image.
- Loading branch information
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
image/cu11.8-py310-torch2.0.1-tensorflow2.14.0-jupyterlab-vscode.Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |