tech-shrimp / docker_image_pusher

使用Github Action将国外的Docker镜像转存到阿里云私有仓库,供国内服务器使用,免费易用
Apache License 2.0
1.58k stars 8.92k forks source link

拉取镜像时报错,好像是提示password标志不安全 #64

Open nihao51 opened 3 months ago

nihao51 commented 3 months ago

Run docker login -u $ALIYUN_REGISTRY_USER -p $ALIYUN_REGISTRY_PASSWORD $ALIYUN_REGISTRY WARNING! Using --password via the CLI is insecure. Use --password-stdin. Error response from daemon: Get "https://***/v2/": unauthorized: authentication required Error: Process completed with exit code 1.

tech-shrimp commented 3 months ago

我感觉是$ALIYUN_REGISTRY 环境变量没配置

CaiJingLong commented 3 months ago

提示 password 不安全是因为这里是用 --password 传给 cli 的 推荐用法是通过管道方式传入,也就是 --password-stdin,以免暴露 echo "$PASSWORD" | docker login -u xxxx --password-stdin

但其实是无所谓的,action 会对 repo 中配置的 secret 自动打码,或者再不济也可以 FORK 仓库后转私有,或者硬分叉。


然后,这里的错误起来和 WARNING 不是一码事,是两个不同的问题。

tanjinc commented 3 months ago

-u 要改成 --username

majinyu666 commented 3 months ago

我也遇了。阿里云重新设置固定密码就好了。感觉像是阿里云的问题,设密码后没有成功更新。