Skip to content

RemoteImage

The RemoteImage resource allows you to pull and manage Docker images using Alchemy.

Usage

typescript
import * as docker from "alchemy/docker";

const myImage = await docker.RemoteImage("nginx", {
  name: "nginx",
  tag: "latest",
});

Properties

NameTypeRequiredDescription
namestringYesDocker image name (e.g., "nginx")
tagstringNoTag for the image (e.g., "latest" or "1.19-alpine")
alwaysPullbooleanNoAlways attempt to pull the image, even if it exists locally

Outputs

NameTypeDescription
imageRefstringFull image reference (name:tag)
createdAtnumberTime when the image was created or pulled

Example

typescript
import * as docker from "alchemy/docker";

// Pull the nginx image
const nginxImage = await docker.RemoteImage("nginx", {
  name: "nginx",
  tag: "latest"
});

// Pull a specific version of Node.js
const nodeImage = await docker.RemoteImage("node-app", {
  name: "node",
  tag: "16-alpine",
  alwaysPull: true
});

// The full image reference can be used when creating containers
console.log(`Pulled image: ${nginxImage.imageRef}`);