102 lines
3.3 KiB
Docker
102 lines
3.3 KiB
Docker
# syntax=docker/dockerfile:1
|
|
# NOTE: Building this image require's docker version >= 23.0.
|
|
#
|
|
# For reference:
|
|
# - https://docs.docker.com/build/dockerfile/frontend/#stable-channel
|
|
ARG TAG_VERSION="22.04"
|
|
FROM ubuntu:${TAG_VERSION}
|
|
ARG HTTP_PROXY
|
|
ARG HTTPS_PROXY
|
|
ENV http_proxy=${HTTP_PROXY}
|
|
ENV https_proxy=${HTTPS_PROXY}
|
|
ARG DEBIAN_FRONTEND="noninteractive"
|
|
ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND}
|
|
ARG ROOT_PASSWD="root"
|
|
ENV ROOT_PASSWD=${ROOT_PASSWD}
|
|
ENV SSH_PORT=3322
|
|
SHELL ["/bin/bash", "-c"]
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# base tools
|
|
RUN <<EOT
|
|
#!/bin/bash
|
|
apt-get update
|
|
apt-get install -y wget curl htop vim openssh-server python3 python3-pip tzdata git zip bzip2 libgl1-mesa-glx g++ sudo software-properties-common build-essential
|
|
. ~/.bashrc
|
|
# Configure SSH for password and public key authentication
|
|
mkdir ~/.ssh
|
|
printf "Host * \n ForwardAgent yes\nHost *\n StrictHostKeyChecking no" > ~/.ssh/config
|
|
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
|
|
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
|
sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config
|
|
sed -i 's/^\(\s*\)GSSAPIAuthentication yes/\1GSSAPIAuthentication no/' /etc/ssh/ssh_config
|
|
sed -i "s/^#Port 22/Port ${SSH_PORT}/" /etc/ssh/sshd_config
|
|
sudo sed -i "s/# Port 22/Port ${SSH_PORT}/" /etc/ssh/ssh_config
|
|
ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa -N "" <<< y
|
|
cat ~/.ssh/id_rsa.pub >> ~/.ssh/auth
|
|
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
|
|
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys2
|
|
chmod 600 /root/.ssh/authorized_keys
|
|
chmod 600 /root/.ssh/authorized_keys2
|
|
mkdir /var/run/sshd
|
|
echo "root:${ROOT_PASSWD}" | chpasswd
|
|
mkdir -p ~/.pip
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
EOT
|
|
|
|
# Copy files
|
|
COPY .condarc mutation.py test.list _foldxLinux64.tar_.gz EvoEF2-master.zip install_scwrl4.0.2_64bit_2020_linux .condarc /app
|
|
|
|
ARG CONDA_ENV_NAME="mutation"
|
|
ENV CONDA_ENV_NAME=${CONDA_ENV_NAME}
|
|
ARG PYTHON_VERSION="3.10"
|
|
ENV PYTHON_VERSION=${PYTHON_VERSION}
|
|
# https://github.com/opendatalab/PDF-Extract-Kit
|
|
RUN <<EOT
|
|
#!/bin/bash
|
|
unzip EvoEF2-master.zip
|
|
chmod +x EvoEF2-master/build.sh
|
|
cd EvoEF2-master
|
|
chmod +x ./build.sh
|
|
./build.sh
|
|
cd ..
|
|
tar zxvf _foldxLinux64.tar_.gz
|
|
chmod +x install_scwrl4.0.2_64bit_2020_linux
|
|
echo -e "Y\nLicense Holder Name" | ./install_scwrl4.0.2_64bit_2020_linux ./
|
|
# install miniconda
|
|
wget -qO- https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh
|
|
bash /tmp/miniconda.sh -b -p /opt/conda
|
|
rm /tmp/miniconda.sh
|
|
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
|
|
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
|
|
. /opt/conda/etc/profile.d/conda.sh
|
|
conda init bash
|
|
conda config --set show_channel_urls true
|
|
# 配置 .condarc 文件
|
|
cat <<EOF > ~/.condarc
|
|
channels:
|
|
- conda-forge
|
|
- bioconda
|
|
- pytorch
|
|
- pytorch-nightly
|
|
- nvidia
|
|
- defaults
|
|
- r
|
|
- https://levinthal:paradox@conda.graylab.jhu.edu
|
|
show_channel_urls: true
|
|
EOF
|
|
source /opt/conda/etc/profile.d/conda.sh
|
|
conda create -n ${CONDA_ENV_NAME} python=${PYTHON_VERSION} click loguru biopython pymol-open-source pyrosetta -y
|
|
conda activate ${CONDA_ENV_NAME}
|
|
rm -rf EvoEF2-master.zip
|
|
EOT
|
|
|
|
VOLUME ["/app"]
|
|
|
|
EXPOSE 3322
|
|
|
|
CMD ["/usr/sbin/sshd", "-D"]
|