Skip to content

Commit 724267a

Browse files
committed
Various tweaks
1 parent 11092b7 commit 724267a

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ the `docker info` command will hang or return an error including the message "Ca
3232
Run the following command to create and deploy a new Worker with a container, from the starter template:
3333

3434
```sh
35-
npm create cloudflare@latest -- --template=cloudflare/templates/hello-world-containers
35+
npm create cloudflare@latest -- --template=cloudflare/templates/containers-template
3636
```
3737

3838
When you want to deploy a code change to either the Worker or Container code, you can run the following command using [Wrangler CLI](/workers/wrangler/:
@@ -46,14 +46,14 @@ When you run `wrangler deploy`, the following things happen:
4646
integrated with your Cloudflare account.
4747
- Wrangler deploys your Worker, and configures Cloudflare's network to be ready to spawn instances of your container
4848

49-
:::note
5049
The build and push usually take the longest on the first deploy. Subsequent deploys
5150
are faster, because they [reuse cached image layers](https://docs.docker.com/build/cache/).
52-
:::
5351

52+
:::note
5453
After you deploy your Worker for the first time, you will need to wait several minutes until
5554
it is ready to receive requests. Unlike Workers, Containers take a few minutes to be provisioned.
5655
During this time, requests are sent to the Worker, but calls to the Container will error.
56+
:::
5757

5858
### Check deployment status
5959

@@ -79,6 +79,7 @@ You can confirm this behavior by reading the output of each request.
7979
## Understanding the Code
8080

8181
Now that you've deployed your first container, let's explain what is happening in your Worker's code, in your configuration file, in your container's code, and how requests are routed.
82+
8283
## Each Container is backed by its own Durable Object
8384

8485
Incoming requests are initially handled by the Worker, then passed to a container-enabled [Durable Object](/durable-objects).
@@ -204,9 +205,9 @@ When a request enters Cloudflare, your Worker's [`fetch` handler](/workers/runti
204205

205206
```js
206207
if (pathname.startsWith("/container")) {
207-
let id = env.MY_CONTAINER.idFromName("container");
208-
let container = env.MY_CONTAINER.get(id);
209-
return await container.fetch(request);
208+
const id = env.MY_CONTAINER.idFromName(pathname);
209+
const container = env.MY_CONTAINER.get(id);
210+
return await container.fetch(request);
210211
}
211212
```
212213

@@ -216,7 +217,7 @@ When a request enters Cloudflare, your Worker's [`fetch` handler](/workers/runti
216217

217218
```js
218219
if (pathname.startsWith("/lb")) {
219-
let container = await getRandom(env.MY_CONTAINER, 3);
220+
const container = await getRandom(env.MY_CONTAINER, 3);
220221
return await container.fetch(request);
221222
}
222223
```

src/content/docs/containers/image-management.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ calls after the initial deploy.
4040
Docker or a Docker-compatible CLI tool must be running for Wrangler to build and push images.
4141
:::
4242

43-
## Using existing images
43+
## Using pre-built container images
4444

4545
If you wish to use a pre-built image, first, push it to the Cloudflare Registry:
4646

src/content/docs/containers/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
Tabs,
2424
Badge,
2525
WranglerConfig,
26+
LinkButton,
2627
} from "~/components";
2728

2829
<Description>
@@ -40,7 +41,7 @@ Worker and `wrangler deploy`.
4041

4142
With Containers you can run:
4243

43-
- Resource-intensive applications that require multiple vCPUs, large amounts of memory or disk space
44+
- Resource-intensive applications that require CPU cores running in parallel, large amounts of memory or disk space
4445
- Applications and libraries that require a full filesystem, specific runtime, or Linux-like environment
4546
- Existing applications and tools that have been distributed as container images
4647

src/content/docs/containers/local-dev.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88
You can run both your container and your Worker locally, without additional configuration, by running [`npx wrangler dev`](/workers/wrangler/commands/#dev) in your project's directory.
99

1010
To develop Container-enabled Workers locally, you will need to first ensure that a
11-
Docker compatible CLI tool is installed. For instance, you can use [Docker Desktop](https://docs.docker.com/desktop/)
11+
Docker compatible CLI tool and Engine are installed. For instance, you can use [Docker Desktop](https://docs.docker.com/desktop/)
1212
on Mac, Windows, or Linux.
1313

1414
When you run `wrangler dev`, your container image will be built or downloaded. If your

src/content/docs/containers/pricing.mdx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,32 @@ sidebar:
99

1010
Containers are billed for every 10ms that they are actively running at the following rates, with included monthly usage as part of the $5 USD per month [Workers Paid plan](/workers/platform/pricing/):
1111

12-
| | Memory | CPU | Disk |
13-
|-------------|-------------------------------------------------------------------------------|-----------------------------------------------------------------------|-------------------------------------------------------------------|
14-
| **Free** | N/A | N/A | |
15-
| **Workers Paid**| 25 GiB-hours/month included <br/> +$0.0000025 per additional GiB-second | 375 vCPU-minutes/month <br/>+ $0.000020 per additional vCPU-second | 200 GB-hours/month <br/> +$0.00000007 per additional GB-second |
12+
| | Memory | CPU | Disk |
13+
| ---------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------ | -------------------------------------------------------------- |
14+
| **Free** | N/A | N/A | |
15+
| **Workers Paid** | 25 GiB-hours/month included <br/> +$0.0000025 per additional GiB-second | 375 vCPU-minutes/month <br/>+ $0.000020 per additional vCPU-second | 200 GB-hours/month <br/> +$0.00000007 per additional GB-second |
1616

1717
You only pay for what you use — charges start when a request is sent to the container or when it is manually started. Charges stop after the container instance goes to sleep, which can happen automatically after a timeout. This makes it easy to scale to zero, and allows you to get high utilization even with bursty traffic.
1818

1919
#### Instance Types
2020

2121
When you add containers to your Worker, you specify an [instance type](/containers/platform-details/#instance-types). The instance type you select will impact your bill — larger instances include more vCPUs, memory and disk, and therefore incur additional usage costs. The following instance types are currently available, and larger instance types are coming soon:
2222

23-
| Name | Memory | CPU | Disk |
24-
|----------|----------|------------|------|
25-
| dev | 256 MiB | 1/16 vCPU | 2 GB |
26-
| basic | 1 GiB | 1/4 vCPU | 4 GB |
27-
| standard | 4 GiB | 1/2 vCPU | 4 GB |
23+
| Name | Memory | CPU | Disk |
24+
| -------- | ------- | --------- | ---- |
25+
| dev | 256 MiB | 1/16 vCPU | 2 GB |
26+
| basic | 1 GiB | 1/4 vCPU | 4 GB |
27+
| standard | 4 GiB | 1/2 vCPU | 4 GB |
2828

2929
## Network Egress
3030

3131
Egress from Containers is priced at the following rates:
3232

33-
TODO
33+
| Region | Price per GB | Included Allotment per month |
34+
| ---------------------- | ------------ | ---------------------------- |
35+
| North America & Europe | $0.025 | 1 TB |
36+
| Oceania, Korea, Taiwan | $0.05 | 500 GB |
37+
| Everywhere Else | $0.04 | 500 GB |
3438

3539
## Workers and Durable Objects Pricing
3640

0 commit comments

Comments
 (0)