惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
V
V2EX
C
Check Point Blog
GbyAI
GbyAI
D
Docker
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
T
Troy Hunt's Blog
博客园 - Franky
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Security Blog
Microsoft Security Blog
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学
The Cloudflare Blog
S
SegmentFault 最新的问题
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
I
InfoQ
博客园 - 【当耐特】
NISL@THU
NISL@THU
A
About on SuperTechFans
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Scott Helme
Scott Helme
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
Security Latest
Security Latest
V
Vulnerabilities – Threatpost
Security Archives - TechRepublic
Security Archives - TechRepublic
A
Arctic Wolf
Hacker News: Ask HN
Hacker News: Ask HN
N
News and Events Feed by Topic
IT之家
IT之家
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
aimingoo的专栏
aimingoo的专栏
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
SecWiki News
SecWiki News
大猫的无限游戏
大猫的无限游戏
S
Security Affairs
The Register - Security
The Register - Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
L
LINUX DO - 热门话题
T
Tor Project blog

Frank's Weblog

Understanding Systemd Timer: Troubleshooting `D-Bus connection terminated` Error 理解Systemd Timer:一次`D-Bus connection terminated`错误排查 Learning Languages Effectively with Anki 使用Anki高效学习语言 Say Goodbye to H1B Anxiety – A Complete Guide for Immigration to Canada via Express Entry 告别H1B焦虑 – 加拿大Express Entry技术移民全流程指南 Project Miata – The Problematic Brake Job Project Miata – 问题百出的刹车维护 Sending Passport from USA to Ottawa for Canadian PR Visa Stamping 加拿大PR贴签:从美国寄护照到渥太华 Building NAS and Installing Unraid 组装NAS及配置Unraid OS Complete Guide for Automotive Paint at Home with Spray Can 使用喷漆罐实现最佳DIY汽车喷漆效果的完整指南 Deploy Containers with Cloudflare Containers 房车旅行:观看星舰发射 电子邮件防伪:SPF, DKIM与DMARC Anti Email Spoofing: SPF, DKIM and DMARC Project Miata – 软顶更换及内饰修复 Project Miata – Soft Top Replacement & Interior Restoration Project Miata – Shifter Rebuild Project Miata – 换挡杆维护 Project Miata – $2000 Project Car Project Miata – $2000玩具车
使用 Cloudflare Containers 部署容器应用
Frank · 2025-06-25 · via Frank's Weblog

English version: Deploy Containers with Cloudflare Container – Frank’s Weblog

今天(2025/6/24),Cloudflare 宣布推出 Cloudflare Containers:其在 Cloudflare Workers 中的无服务器容器运行时。Cloudflare Containers 目前处于公开测试阶段,所有 Cloudflare Worker 的付费用户都可以使用。

作为一名容器爱好者,我花了一些时间探索该产品。我将以 httpbin 为例,说明如何将一个简单的应用程序部署到 Cloudflare Containers。

先决条件

  • Nodejs
  • wrangler (Cloudflare worker 命令行工具)
  • Docker
  • Cloudflare Workers 付费计划

代码

你需要的所有代码都在这里: https://github.com/frankgx97/httpbin-cfcontainers

src/index.ts 是应用程序的入口点,它将请求路由到容器。

wrangler.jsonc 是 Cloudflare Worker 应用程序的定义文件,我们在其中定义应用程序、容器和持久对象。

部署

在部署之前,我们需要准备镜像。

Cloudflare Containers 仅支持 Cloudflare Image Registry。你可以在部署应用程序时通过指定 "image": "./Dockerfile" 来构建和发布镜像,或者,在本例中,将现有镜像推送到 Cloudflare Registry。

假设镜像已在本地存在,请先 tag 镜像。

docker tag kennethreitz/httpbin httpbin:1

请注意,镜像必须有标签,并且不能是 latest

wrangler containers push httpbin:1

你将获得格式为 registry.cloudflare.com/(随机字符串)/httpbin:1 的新镜像标签。

将新的镜像标签填入 wrangler.jsonc

然后运行 wrangler deploy

访问 wrangler 返回的链接,你应该能看到已部署的应用程序。

References

  1. https://github.com/megaconfidence/wifski
  2. Cloudflare Containers 101 – Run Docker Containers on the Edge – YouTube
  3. Containers are available in public beta for simple, global, and programmable compute