cowardly refusing to save to a terminal. Use the -o flag or redirect

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值