首页 > 解决方案 > 在 docker 图像上使用 curl 而不是 wget

问题描述

我们正在使用wget内部 docker 图像,它工作正常,我们想切换到curl但它不起作用

这是之前使用 wget 的命令

wget https://github.sme.corp/wiki-raw/dwi/bre/dists/stable/Key.gpg.key -O- | apt-key add - && \
echo "deb https://github.sme.corp/wiki-raw/dwi/bre/ stable main" > /etc/apt/sources.list.d/bre.list && \

我尝试将其更改为如下所示的 curl 并且它不起作用(我没有看到相同的输出),知道我在这里缺少什么吗?

curl -sSL -f -k https://github.sme.corp/wiki-raw/dwi/bre/dists/stable/Key.gpg.key | apt-key add - && \
echo "deb https://github.sme.corp/wiki-raw/dwi/bre/ stable main" > /etc/apt/sources.list.d/bre.list && \

标签: linuxdockercurlwget

解决方案


尝试如下 curl 命令

curl -f -L -o <<weblink to the file>>

推荐阅读