Skip to content

Image

Source: src/Docker/Image.ts

Builds, tags, and optionally pushes Docker images through the active Docker context.

This resource uses the Docker CLI and whatever daemon or remote context the CLI is configured to target. It is separate from Cloudflare.Container; registry image references are the boundary between Docker-managed images and cloud container platforms.

Image always builds from a Dockerfile. To pull (and optionally re-tag and push) an existing registry image, use Docker.RemoteImage.

const image = yield* Docker.Image("app", {
name: "my-app",
tag: "latest",
build: {
context: "./app",
dockerfile: "Dockerfile",
args: { NODE_ENV: "production" },
},
});
const image = yield* Docker.Image("app", {
name: "my-app",
build: { context: "./app" },
registry: {
server: "ghcr.io",
username: "octocat",
password: Config.redacted("GITHUB_TOKEN"),
},
});