command
docker ps 查看现在运行的docker
docker exec -it [name] 运行
docker stop [name] 停止运行
sudo chown -R USER . 有的时候docker会让一些folder失去permission,这个时候change owner (chown), -R是recursive,后面跟着新的user
notes
每次打开terminal可以: sudo apt-get update
如果sudo apt install package失败,可以sudo apt --fix-broken install,然后再重新install。
Docker
build docker
docker build -t my-image -f docker/Dockerfile .
-t (tag): 给image一个name和optionally一个version tag,比如my-image:1.0,或者之际my-image,会默认为my-image:latest
-f (file): docker file位置
. : 指定build directory
push to DockerHub
docker login
docker tag my-image myusername/myrepo
docker push myusername/myrepo
如果只想要一个docker的环境,可以把CMD行(如果有的话)取消掉,然后再上传。
optional: 在myusername/myrepo后加:version-tag
Singularity
安装
先查看自己ubuntu系统的version,再找对应的version
lsb_release -a
- focal Ubuntu 20.04.
- jammy Ubuntu 22.04.
进入singularity github release https://github.com/sylabs/singularity/releases
根据系统focal还是jammy,找到相应的deb,复制链接。
wget link
下载好之后,sudo dpkg --install 【file.deb】
然后, sudo apt-get install -yf
查看版本:singularity --version
使用
build
cd alphafold3
docker build -t alphafold3 -f docker/Dockerfile .
docker run -d -p 5000:5000 --restart=always --name registry registry:2
docker tag alphafold3 localhost:5000/alphafold3
docker push localhost:5000/alphafold3
# NO HTTPS indicate that this is localhost, not from http
SINGULARITY_NOHTTPS=1 singularity build alphafold3.sif docker://localhost:5000/alphafold3:latest
Run
singularity exec --nv alphafold3.sif \
python -u alphafold3/run_alphafold.py \
--input_dir=af_input_ECD_Immunoglobulin/folder_3 \
--model_dir=af_models \
--output_dir=af_output_ECD_Immunoglobulin \
--norun_data_pipeline | tee run.log
Apptainer
install
check https://github.com/apptainer/apptainer/blob/main/INSTALL.md
apt-get update
apt-get install -y \
build-essential \
libseccomp-dev \
pkg-config \
uidmap \
squashfs-tools \
fakeroot \
cryptsetup \
tzdata \
dh-apparmor \
curl wget git
check .deb files in release https://github.com/apptainer/apptainer/releases
get latest version, download through wget
wget link
dpkg -i apptainer_1.3.5_amd64.deb
apt-get install -f
if any of not work, use (with or without sudo)
sudo apt --fix-broken install
sudo apt update
sudo apt upgrade
build from docker
apptainer build af3.sif docker://cford38/alphafold3
build from local .def file
apptainer build af3.sif singularity.def