docker和Singularity的简单使用命令

docker 菜鸟教程: https://www.runoob.com/docker/docker-tutorial.html

做个小笔记,方便用

1. docker

# 使用docker
# pull
docker pull nservant/hicpro:latest
# 删除镜像
docker rmi nservant/hicpro:latest
# 查看已经安装的镜像
docker images
# 查看运行的容器
docker ps
# 查看所有容器运行状态
docker ps -a
# 查看容器内标准输出
docker logs 8e4a57f49da2 #容器ID
# 停止容器
docker stop 8e4a57f49da2
# 重启容器
docker restart 8e4a57f49da2

# run一个容器(等效于create+start) 不指定tag时,默认以latest镜像运行
docker run -it nservant/hicpro /bin/bash
# 退出容器
exit

# 如果在run的时候加入-d参数,容器会后台运行
# docker attach + exit 可以进入容器、退出容器,并会导致容器停止
# docker exec + exit 可以进入容器、退出容器,容器不会停止

# exec进入容器举例
docker exec -it f5b4e7215245 /bin/bash

# 清理掉所有处于终止状态的容器
docker container prune

#进入容器 并挂载一个工作目录,-v参数的冒号(:)左边是本地目录,右边是docker容器中的目录
docker run -v /mnt/caigui/41_sk_genome_129M/37_hicpro:/mnt/caigui/41_sk_genome_129M/37_hicpro -itd nservant/hicpro:latest /bin/bash

# docker运行hicpro的实例
docker run -v /mnt/caigui/41_sk_genome_129M/37_hicpro:/mnt/caigui/41_sk_genome_129M/37_hicpro -itd nservant/hicpro:latest /bin/bas
docker ps -a
docker exec -it f5b4e7215245 /bin/bash
cd /mnt/caigui/41_sk_genome_129M/37_hicpro
/HiC-Pro_3.0.0/bin/HiC-Pro -i /mnt/caigui/41_sk_genome_129M/37_hicpro/fastq -o /mnt/caigui/41_sk_genome_129M/37_hicpro/Resultes -c /mnt/caigui/41_sk_genome_129M/37_hicpro/config_hicpro.txt

# 额外的一个小例子
# 运行一个web程序
docker pull training/webapp
docker run -d -P training/webapp python app.py
docker ps #查看开放的端口
# 浏览器访问http://10.10.81.248:32768/
docker top #来查看容器内部运行的进程

2. Singularity

# 安装Singularity
# 在http://neuro.debian.net/选择系统版本和下载源
wget -O- http://neuro.debian.net/lists/buster.cn-hf.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9
sudo apt-get update
sudo apt-get install -y singularity-container

# pull
singularity pull shub://DoaneAS/HiC-Pro:latestles

# 直接用里面的命令,举例
singularity exec sing/DoaneAS-HiC-Pro-master-latest.simg HiC-Pro -i /mnt/caigui/41_sk_genome_129M/37_hicpro/RAWDATA -o /mnt/caigui/41_sk_genome_129M/37_hicpro/Resultes -c /mnt/caigui/41_sk_genome_129M/37_hicpro/config_hicpro.txt
singularity exec sing/DoaneAS-HiC-Pro-master-latest.simg /home/caigui/software/HiC-Pro-3.1.0/bin/utils/digest_genome.py -r DpnII -o /mnt/caigui/41_sk_genome_129M/37_hicpro/reference/genome_DpnII.bed /mnt/caigui/41_sk_genome_129M/37_hicpro/reference/genome.fa

results matching ""

    No results matching ""