Skip to content

Commit 40d140e

Browse files
committed
Further progress
1 parent bbafb9c commit 40d140e

File tree

9 files changed

+213
-87
lines changed

9 files changed

+213
-87
lines changed

src/content/docs/containers/containers-api.mdx

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/content/docs/containers/examples/index.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ sidebar:
1111

1212
import { GlossaryTooltip, ListExamples } from "~/components";
1313

14-
Explore the following <GlossaryTooltip term="code example">examples</GlossaryTooltip> for Containers.
14+
Container Examples are Coming Soon!
15+
16+
{/* Examples to add:
17+
- Statelss routing (FFMPEG)
18+
- Stateful app
19+
- Regional placement
20+
- Workflow Integration
21+
- Queue Integration
22+
- AI-generated code execution
23+
- Batch Workload for CI (chaining multiple) */}
24+
25+
{/* Explore the following <GlossaryTooltip term="code example">examples</GlossaryTooltip> for Containers. */}
1526

1627
<ListExamples directory="containers/examples/" />

src/content/docs/containers/get-started.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ In this example, each container runs a small webserver written in Go.
1010

1111
Requests are initially handled by the Worker, then passed to container-enabled [Durable Objects](/durable-objects).
1212
Each Durable Object runs alongside a container, manages starting and stopping it, and
13-
can interact with the container through its ports.
13+
can interact with the container through its ports. Containers will likely run near the Worker instance
14+
requesting them, but not necessarily. See ["How Locations are Selected"](/containers/reference/platform-details/#how-are-locations-are-selected)
15+
for details.
1416

1517
In a simple app, the Durable Object may just boot the container and proxy requests to it.
1618

src/content/docs/containers/reference/closed-beta-info.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
pcx_content_type: reference
3-
title: Private Beta Info
3+
title: Closed Beta Info
44
sidebar:
5-
order: 6
5+
order: 1
66
---
77

88
Currently, Containers are in private beta. We plan to make Containers available in open beta in several months.
@@ -17,8 +17,8 @@ There are several known changes we plan to make prior to open beta, as well as m
1717
We plan to make the following changes:
1818

1919
- Add Logs to the Dashboard
20-
- Add autoscaling and load balancing to Containers
21-
- Add atomic Worker updates so Worker code and Container code stay in sync
20+
- Add autoscaling and load balancing to Containers, using the interface `env.MY_CONTAINER.fetch()`
21+
- Ensure Worker code and Container code stay in sync with atomic code updates
2222
- Improve the local dev experience
2323
- Expose more information on Container Settings in the dashboard
2424
- Increase limits on number of containers and container size
@@ -46,3 +46,5 @@ There are several areas where we wish to gather feedback from users:
4646
- Do you need different mechanisms for routing requests to containers?
4747
- Do you need different mechanisms for scaling containers?
4848
- Do you want to integrate Containers with any other Cloudflare services? If so, which ones and how?
49+
50+
At any point during the Beta, feel free to [give feedback using this form](https://forms.gle/CscdaEGuw5Hb6H2s7).

src/content/docs/containers/reference/limits.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@
22
pcx_content_type: concept
33
title: Limits
44
sidebar:
5-
order: 4
5+
order: 3
66
---
77

88
import { Render } from "~/components";
99

10-
Containers limits are detailed below.
10+
Containers limits are detailed below:
1111

1212
| Feature | Workers Paid |
1313
| -------------------------------------- | ------------ |
1414
| Container Count | 10 [^1] |
1515
| Max Concurrent Instances per Container | 20 [^1] |
1616
| Max Concurrent Instances per Account | 100 |
17-
| Images in Registry | X |
18-
| Image Size | X |
17+
| Images in Registry | None [^2] |
18+
| Image Size | None [^2] |
19+
| Unused Retention Period | None [^2] |
1920

2021
[^1]: This limit will be raised as we continue the private beta.
22+
23+
[^2]: There is currently no limit, but there will be in the future.

src/content/docs/containers/reference/platform-details.mdx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,41 @@
22
pcx_content_type: navigation
33
title: Platform Details
44
sidebar:
5-
order: 8
5+
order: 2
66
group:
77
hideIndex: true
88
---
99

10+
This page contains various details about the Containers platform:
11+
12+
## How locations are selected
13+
14+
When initially deploying a Container, Cloudflare will select various locations across our
15+
network to deploy instances to. These locations will span multiple regions.
16+
17+
When a Container instance is requested with `this.ctx.container.start`, the nearest free
18+
container instance will be selected from the pre-initialized locations. This will
19+
likely be in the same region as the external request, but may not be. Once the container
20+
instance is running, any future requests will be routed to the initial location.
21+
22+
An Example:
23+
24+
- A user deploys a Container. Cloudflare automatically readies instances across its Network.
25+
- A request is made from a client in Bariloche, Argentia. It reaches the Worker in
26+
Cloudflare's location in Neuquen, Argentina.
27+
- This Worker request calls `MY_CONTAINER.get("session-1337")` which brings up a Durable
28+
Object, which then calls `this.ctx.container.start`.
29+
- This requests the nearest free Container instance.
30+
- Cloudflare recognizes that an instance is free in Buenos Aires, Argentina, and
31+
starts it there.
32+
- A different user needs to route to the same container. This user's request reaches
33+
the Worker running in Cloudflare's location in San Diego.
34+
- The Worker again calls `MY_CONTAINER.get("session-1337")`.
35+
- If the initial container instance is still running, the request is routed to the location
36+
in Buenos Aires. If the initial container has gone to sleep, Cloudflare will once
37+
again try to find the nearest "free" instance of the Container, likely
38+
one in North America, and start an instance there.
39+
1040
## Environment variables
1141

1242
The container runtime automatically sets the following variables:

src/content/docs/containers/reference/pricing.mdx

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,78 +2,18 @@
22
pcx_content_type: reference
33
title: Pricing
44
sidebar:
5-
order: 6
5+
order: 4
66
---
77

8-
By default, all users are on the Images Free plan. The Free plan includes access to the transformations feature, which lets you optimize images stored outside of Images, like in R2.
8+
## Closed Beta Pricing
99

10-
The Paid plan allows transformations, as well as access to storage in Images.
10+
During the closed beta, Containers are free to run and images stored
11+
in the Cloudflare Registry are free of cost.
1112

12-
Pricing is dependent on which features you use. The table below shows which metrics are used for each use case.
13+
Users will be charged standard pricing for both [Workers](/workers/platform/pricing/) and
14+
[Durable Objects](/durable-objects/platform/pricing/), both of which are necessary to
15+
interact with Containers.
1316

14-
| Use case | Metrics | Availability |
15-
| ----------------------------------------------------- | ------------------------------- | ------------------- |
16-
| Optimize images stored outside of Images | Images Transformed | Free and Paid plans |
17-
| Optimized images that are stored in Cloudflare Images | Images Stored, Images Delivered | Only Paid plans |
17+
## Long-term Pricing
1818

19-
## Images Free
20-
21-
On the Free plan, you can request up to 5,000 unique transformations each month for free.
22-
23-
Once you exceed 5,000 unique transformations:
24-
25-
- Existing transformations in cache will continue to be served as expected.
26-
- New transformations will return a `9422` error. If your source image is from the same domain where the transformation is served, then you can use the [`onerror` parameter](/images/transform-images/transform-via-url/#onerror) to redirect to the original image.
27-
- You will not be charged for exceeding the limits in the Free plan.
28-
29-
To request more than 5,000 unique transformations each month, you can purchase an Images Paid plan.
30-
31-
## Images Paid
32-
33-
When you purchase an Images Paid plan, you can choose your own storage or add storage in Images.
34-
35-
| Metric | Pricing |
36-
| ------------------ | ------------------------------------------------------------------------------------------ |
37-
| Images Transformed | First 5,000 unique transformations included + $0.50 / 1,000 unique transformations / month |
38-
| Images Stored | $5 / 100,000 images stored / month |
39-
| Images Delivered | $1 / 100,000 images delivered / month |
40-
41-
If you optimize an image stored outside of Images, then you will be billed only for Images Transformed.
42-
43-
Alternatively, Images Stored and Images Delivered apply only to images that are stored in your Images bucket. When you optimize an image that is stored in Images, then this counts toward Images Delivered — not Images Transformed.
44-
45-
## Metrics
46-
47-
### Images Transformed
48-
49-
A unique transformation is a request to transform an original image based on a set of [supported parameters](/images/transform-images/transform-via-url/#options). This metric is used only when optimizing images that are stored outside of Images.
50-
51-
For example, if you transform `thumbnail.jpg` as 100x100, then this counts as 1 unique transformation. If you transform the same `thumbnail.jpg` as 200x200, then this counts as a separate unique transformation.
52-
53-
You are billed for the number of unique transformations that are counted during each billing period.
54-
55-
Unique transformations are counted over a 30-day sliding window. For example, if you request `width=100/thumbnail.jpg` on June 30, then this counts once for that billing period. If you request the same transformation on July 1, then this will not count as a billable request, since the same transformation was already requested within the last 30 days.
56-
57-
The `format` parameter counts as only 1 billable transformation, even if multiple copies of an image are served. In other words, if `width=100,format=auto/thumbnail.jpg` is served to some users as AVIF and to others as WebP, then this counts as 1 unique transformation instead of 2.
58-
59-
#### Example
60-
61-
A retail website has 1,000 original product images that get served in 5 different sizes each month. This results in 5,000 unique transformations — or a cost of $2.50 per month.
62-
63-
### Images Stored
64-
65-
Storage in Images is available only with an Images Paid plan. You can purchase storage in increments of $5 for every 100,000 images stored per month.
66-
67-
You can create predefined variants to specify how an image should be resized, such as `thumbnail` as 100x100 and `hero` as 1600x500.
68-
69-
Only uploaded images count toward Images Stored; defining variants will not impact your storage limit.
70-
71-
### Images Delivered
72-
73-
For images that are stored in Images, you will incur $1 for every 100,000 images delivered per month. This metric does not include transformed images that are stored in remote sources.
74-
75-
Every image requested by the browser counts as 1 billable request.
76-
77-
#### Example
78-
79-
A retail website has a product page that uses Images to serve 10 images. If the page was visited 10,000 times this month, then this results in 100,000 images delivered — or $1.00 in billable usage.
19+
Full information on long-term pricing of Containers is coming soon.

src/content/docs/workers/wrangler/commands.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ wrangler init [<NAME>] [OPTIONS]
157157

158158
---
159159

160+
## `containers`
161+
162+
Interact with Cloudflare's Container Platform.
163+
164+
:::note
165+
Currently `wrangler containers` does not exist. You will have to use `wrangler cloudchamber` instead.
166+
167+
This will include several commands that will not work properly on your account if you are in the private beta.
168+
:::
169+
170+
<Render file="wrangler-commands/containers" product="workers" />
171+
160172
## `d1`
161173

162174
Interact with Cloudflare's D1 service.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
{}
3+
---
4+
5+
import { Render, AnchorHeading, Type, MetaInfo } from "~/components";
6+
7+
<AnchorHeading title="`build`" slug="containers-build" depth={3} />
8+
9+
Build a Container image from a Dockerfile.
10+
11+
```txt
12+
wrangler containers build [PATH] [OPTIONS]
13+
```
14+
15+
- `PATH` <Type text="string" /> <MetaInfo text="optional" />
16+
- Path for the directory containing the Dockerfile to build.
17+
18+
#### Options:
19+
20+
- `-t, --tag` <Type text="string" /> <MetaInfo text="required" />
21+
- Name and optionally a tag (format: "name:tag").
22+
- `--path-to-docker` <Type text="string" /> <MetaInfo text="optional" />
23+
- Path to your docker binary if it's not on $PATH.
24+
- Default: "docker"
25+
- `-p, --push` <Type text="boolean" /> <MetaInfo text="optional" />
26+
- Push the built image to Cloudflare's managed registry.
27+
- Default: false
28+
- `--platform` <Type text="string" /> <MetaInfo text="optional" />
29+
- Platform to build for. Defaults to the architecture supported by Workers (linux/amd64).
30+
- Default: "linux/amd64"
31+
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
32+
- Return output as clean JSON.
33+
- Default: false
34+
35+
<AnchorHeading title="`delete`" slug="containers-delete" depth={3} />
36+
37+
Delete a Container (application).
38+
39+
```txt
40+
wrangler containers delete <CONTAINER_ID> [OPTIONS]
41+
```
42+
43+
- `CONTAINER_ID` <Type text="string" /> <MetaInfo text="required" />
44+
- The ID of the Container to delete.
45+
- `-y, --skip-confirmation` <Type text="boolean" /> <MetaInfo text="optional" />
46+
- Skip deletion confirmation prompt.
47+
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
48+
- Return output as JSON rather than a table.
49+
50+
<AnchorHeading title="`images`" slug="containers-images" depth={3} />
51+
52+
Perform operations on images in your containers registry.
53+
54+
<AnchorHeading title="`images list`" slug="containers-images-list" depth={4} />
55+
56+
List images in your containers registry.
57+
58+
```txt
59+
wrangler containers images list [OPTIONS]
60+
```
61+
62+
#### Options:
63+
64+
- `--filter` <Type text="string" /> <MetaInfo text="optional" />
65+
- Regex to filter results.
66+
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
67+
- Return output as clean JSON.
68+
- Default: false
69+
70+
<AnchorHeading
71+
title="`images delete`"
72+
slug="containers-images-delete"
73+
depth={4}
74+
/>
75+
76+
Remove an image from your containers registry.
77+
78+
```txt
79+
wrangler containers images delete [IMAGE] [OPTIONS]
80+
```
81+
82+
- `IMAGE` <Type text="string" /> <MetaInfo text="required" />
83+
- Image to delete.
84+
85+
#### Options:
86+
87+
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
88+
- Return output as clean JSON.
89+
- Default: false
90+
91+
<AnchorHeading title="`info`" slug="containers-info" depth={3} />
92+
93+
Get information about a specific Container, including top-level details and a list of instances.
94+
95+
```txt
96+
wrangler containers info <CONTAINER_ID> [OPTIONS]
97+
```
98+
99+
- `CONTAINER_ID` <Type text="string" /> <MetaInfo text="required" />
100+
- The ID of the Container to get information about.
101+
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
102+
- Return output as JSON rather than a table.
103+
104+
<AnchorHeading title="`list`" slug="containers-list" depth={3} />
105+
106+
List the Containers in your account.
107+
108+
```txt
109+
wrangler containers list [OPTIONS]
110+
```
111+
112+
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
113+
- Return output as JSON rather than a table.
114+
115+
<AnchorHeading title="`push`" slug="containers-push" depth={3} />
116+
117+
Push a tagged image to a Cloudflare managed registry, which is automatically integrated with your account.
118+
119+
```txt
120+
wrangler containers push [TAG] [OPTIONS]
121+
```
122+
123+
- `TAG` <Type text="string" /> <MetaInfo text="required" />
124+
- The name and tag of the container image to push.
125+
126+
#### Options:
127+
128+
- `--path-to-docker` <Type text="string" /> <MetaInfo text="optional" />
129+
- Path to your docker binary if it's not on $PATH.
130+
- Default: "docker"
131+
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
132+
- Return output as clean JSON.
133+
- Default: false

0 commit comments

Comments
 (0)