0

我已经运行 docker run 来生成一个文件

sudo docker run -i --mount type=bind,src=/home/mathed/Simulation/custom_desman/1/Strains/Simulation2/Assembly,target=/home/mathed/Simulation/custom_desman/1/Strains/Simulation2/Assembly 990210oliver/mycc.docker:v1 MyCC.py /home/mathed/Simulation/custom_desman/1/Strains/Simulation2/Assembly/final_contigs_c10K.fa

这是我执行后得到的消息。

20181029_0753
4mer
1_rename.py /home/mathed/Simulation/custom_desman/1/Strains/Simulation2/Assembly/final_contigs_c10K.fa 1000
Seqs >= 1000 : 32551
Minimum contig lengh for first stage clustering: 1236
run Prodigal.
/opt/prodigal.linux -i My.fa -a gene.aa -d gene.nuc -f gbk -o output -s potential_genes.txt
run fetchMG.
run UCLUST.
Get Feature.
2_GetFeatures_4mer.py for fisrt stage clustering
2_GetFeatures_4mer.py for second stage clustering
3_GetMatrix.py 1236 for fisrt stage clustering 
 22896 contigs entering first stage clustering
Clustering...
1_bhsne.py 20
2_ap.py /opt/ap 500 0
Cluster Correction.
to Split and Merge.
1_ClusterCorrection_Split.py 40 2
2_ClusterCorrection_Merge.py 40
Get contig by cluster.
20181029_0811

我现在想获取 MyCC.py 生成的文件来托管。
在阅读Copying files from Docker container to host之后,我尝试了,

sudo docker cp 642ef90103be:/opt /home/mathed/data

但我收到一条错误消息

mkdir /home/mathed/data/opt: permission denied

有没有办法将生成的文件放到目录/home/mathed/data 中?
谢谢你。

4

1 回答 1

0

我假设您的目标路径不存在。 Docker cp doc统计在这种情况下:

SRC_PATH specifies a directory
    DEST_PATH does not exist
        DEST_PATH is created as a directory and the contents of the source directory are copied into this directory

因此它试图从 DEST_PATH... 创建一个目录,并且 docker 必须有权这样做。根据 DEST_PATH 顶级现有目录的所有者,您可能必须

  • 首先创建目录,以便它不会由 docker 创建并使用 sudo chown {user}:{folder} + chmod +x {folder}为其赋予正确的权限(看起来它没有这样做的权限)
  • 更改父现有目录的权限(chown + chmod再次),
  • 切换到允许 docker 写入的路径。
于 2018-10-29T09:03:56.607 回答