docker仓库需要保存一些镜像到其他节点主机,通过命令docker save执行出现cowardly refusing to save to a terminal. Use the -o flag or redirect报错,由于命令执行错误导致
正确方式:
[root@node-1 ~]# for i in {1..5} ;do docker images |grep calico |awk 'NR=='${i}'{print $3}' ; docker save -o ${i}.tar $(docker images |grep calico |awk 'NR=='${i}'{print $3}') ; done
13b6f63a50d6
1470783b1474
a696ebcb2ac7
2858353c1d25
8ed9dbffe350
错误方式:
[root@node-1 ~]# for i in {1..5} ;do docker images |grep calico |awk 'NR=='${i}'{print $3}' ; docker save $(docker images |grep calico |awk 'NR=='${i}'{print $3}') $i.tar; done
13b6f63a50d6
cowardly refusing to save to a terminal. Use the -o flag or redirect
1470783b1474
cowardly refusing to save to a terminal. Use the -o flag or redirect
a696ebcb2ac7
cowardly refusing to save to a terminal. Use the -o flag or redirect
2858353c1d25
cowardly refusing to save to a terminal. Use the -o flag or redirect
8ed9dbffe350
cowardly refusing to save to a terminal. Use the -o flag or redirect
docker save 镜像ID > *.tar