基于Alpine Linux的轻量级Docker镜像,集成了curl命令行工具,专为网络数据传输设计。支持HTTP、HTTPS、FTP等多种协议,可用于API测试、文件下载、服务监控等场景。得益于Alpine的精简特性,镜像体积小巧,启动快速,非常适合在容器化环境中执行临时网络请求或自动化任务,是开发调试、CI/CD流程及微服务健康检查的理想工具。

15 次收藏下载次数: 0状态:社区镜像维护者:Alpine 工具与轻量镜像仓库类型:镜像最近更新:
下载命令
点击查看

alpine/curl

If enjoy, please *** buying me a coffee.

Alpine-based image with just curl

NOTES: the original upstream https://github.com/appropriate/docker-curl is in read-only (archived statue), its images used base image of alpine:3.7, and are 4 years old now, vulnerabilities in its image, which is risk to use it.

This repo will manage with latest alpine version, and passed trivy scan.

update

If you need HTTP/3 supported, please use another image alpine/curl-http3 at https://hub.docker.com/repository/docker/alpine/curl-http3/general

Usage

  • with docker run
console
$ docker run --rm alpine/curl -fsSL https://www.google.com/

Or use it as alias command

alias curl="docker run --rm alpine/curl"

curl -fsSL https://www.google.com/
  • with kubectl run
# Each execution typically takes approximately 5 to 10 seconds due to the need to pull the image and create the pod.
kubectl run curl  --rm -it  --image=alpine/curl -- -fsSL https://www.google.com/

# if you want to test the service within kubernetes cluster, 
$ kubectl get service

# suppose, "productpage" is the service name, and "9080" is the service port
# productpage   ClusterIP   10.99.117.108    <none>        9080/TCP   123m

kubectl run curl --rm -it  --image=alpine/curl -- -sS productpage.default:9080/index.html

There is a rare case, that your kubernetes has https://istio.io/latest/docs/setup/additional-setup/sidecar-injection/#controlling-the-injection-policy (or similar sidecar solution) set as true, https://istio.io/latest/docs/ops/common-problems/injection/#:~:text=the injected pods.-,Pod or containers start with network issues if istio-proxy,sidecar container is not ready.. So we need add extra option to reject that setting.

kubectl run curl --rm -it --overrides='{ "apiVersion": "v1", "metadata": { "labels": { "sidecar.istio.io/inject": "false" } } }' --image=alpine/curl --  -sS productpage.default:9080/productpage

or use it as alias command

alias kubecurl="kubectl run curl  --rm -it  --image=alpine/curl --"

kubecurl -fsSL https://www.google.com/

Tags

  • alpine/curl:8.1.2: based on curl version

Scan passed

The image is passed the trivy scan, you can run command to confirm

$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
    -v $HOME/Library/Caches:/root/.cache/  aquasec/trivy image alpine/curl

...
================================
Total: 0 (UNKNOWN: 0, LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 0)

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 curl 镜像标签

docker pull docker.xuanyuan.run/alpine/curl:<标签>

DockerHub 原生拉取命令

docker pull alpine/curl:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告