Files
mutation/Dockerfile_developer
2023-12-03 23:01:00 +08:00

57 lines
3.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Use Ubuntu 22.04 as base image
FROM ubuntu:22.04
LABEL maintainer="lingyu zeng <pylyzeng@gmail.com>"
ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive
# $(curl https://ipapi.co/timezone)
# Configure timezone and install necessary packages
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
apt-get update && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apt-get install -y tzdata && \
apt-get install -y git zip curl wget bzip2 libgl1-mesa-glx g++ sudo software-properties-common && \
adduser --disabled-password --gecos "" developer && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
sudo apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set environment variables
ENV PATH="/home/developer/bin:/home/developer/micromamba/bin:${PATH}"
ENV CONDA_PREFIX="/home/developer/micromamba/envs/pyrosetta"
# Switch to user developer
USER developer
# Set working directory
WORKDIR /home/developer
# Copy necessary files to the working directory
COPY --chown=developer .condarc mutation.py 4i24.pdb test.list _foldxLinux64.tar_.gz EvoEF2-master.zip install_scwrl4.0.2_64bit_2020_linux pyrosetta-2023.31+release.1799523-py311_0.tar.bz2 noarch/repodata.json .condarc /home/developer/
# Update and install necessary packages
RUN unzip EvoEF2-master.zip && \
chmod +x EvoEF2-master/build.sh && \
cd EvoEF2-master && \
./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 Micromamba
wget -qO- https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba && \
./bin/micromamba shell init --shell bash --root-prefix=~/micromamba && \
mkdir -p ~/noarch && mkdir ~/work && sudo chmod -R 777 ~/work && \
mv repodata.json ~/noarch && \
mv pyrosetta-2023.31+release.1799523-py311_0.tar.bz2 ~/noarch && \
./bin/micromamba create -n pyrosetta -c conda-forge -c bioconda -c defaults python=3.11 click loguru biopython pymol-open-source pyrosetta-2023.31+release.1799523-py311_0.tar.bz2 -y && \
rm -rf EvoEF2-master.zip install_scwrl4.0.2_64bit_2020_linux _foldxLinux64.tar_.gz ~/noarch
WORKDIR /home/developer/work
VOLUME ["/home/developer/work"]
ENTRYPOINT ["/home/developer/micromamba/envs/pyrosetta/bin/python", "/home/developer/mutation.py"]
# 普通用户使用的版本总有奇怪的权限问题待解决可以考虑使用Dockerfile构建root用户的镜像通过测试
# PermissionError: [Errno 13] Permission denied: '/home/developer/work/4i24.clean.pdb'
# docker run --rm -it -v /home/zenglingyu/tools/dockertest:/home/developer/work hotwa/test1:latest rosetta -p /home/developer/work/4i24.pdb -m /home/developer/work/test.list
# 映射宿主机的目录/home/zenglingyu/tools/dockertest权限要求是777否则会报错