我想执行此命令:
docker run --volumes-from dbdata2 -v $(pwd):/backup ubuntu cd /dbdata && tar xvf /backup/backup.tar
如此处所述http://docs.docker.com/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes
但是我收到以下错误:
exec: "cd": executable file not found in $PATH
Error response from daemon: Cannot start container a5da18532a63195f421757ab294c8fab82cd8e8beccb1ef29998d4b8b1293b43: [8] System error: exec: "cd": executable file not found in $PATH
任何想法都错了吗?
答案 0 :(得分:5)
如果您阅读使用泊坞窗http://docs.docker.com/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes进行备份和还原,则可能会遇到命令
的问题int[] ages = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int[] temp = new int[20];
System.arraycopy(ages, 0, temp, 0, ages.length);
System.out.println(Arrays.toString(temp));
无法正常工作,因为该命令是由docker建议的。它会给出错误:
docker run --volumes-from dbdata2 -v $(pwd):/backup ubuntu cd /dbdata && tar xvf /backup/backup.tar
一个简单的解决方案是包装cd命令:
exec: "cd": executable file not found in $PATH