Container
Create and manage Docker containers with support for port mappings, volumes, networks, and healthchecks.Properties
Image to use for the container. Can be an Alchemy Image or RemoteImage resource or a string image reference.
Container name.Default:
${app}-${stage}-${id}Command to run in the container.
Environment variables for the container.
Port mappings between host and container.Each mapping has:
external: Host portinternal: Container portprotocol: “tcp” or “udp” (optional)
Volume mappings between host and container.Each mapping has:
hostPath: Path on hostcontainerPath: Path in containerreadOnly: Whether volume is read-only (optional)
Restart policy for the container.
Networks to connect the container to.Each mapping has:
name: Network name or IDaliases: Network aliases (optional)
Whether to remove the container when it exits.
Start the container after creation.
Healthcheck configuration with:
cmd: Command to run (string or array)interval: Time between checks (Duration)timeout: Max time for check (Duration)retries: Consecutive failures neededstartPeriod: Initialization time (Duration)startInterval: Check interval during start (Duration)
Whether to adopt the container if it already exists.Default:
falseReturns
Container ID assigned by Docker.
Container name.
Current state of the container.
Timestamp when the container was created.
Function to inspect the container and get detailed runtime information including port mappings.
Examples
Create a simple Nginx container
Container with environment and volumes
Container with healthcheck
Image
Build and manage Docker images from Dockerfiles with support for multi-stage builds, build arguments, and registry push.Properties
Repository name for the image (e.g., “username/image”).Default: The resource ID
Tag for the image (e.g., “latest”).Default:
"latest"Build configuration with:
context: Build context directorydockerfile: Path to Dockerfileplatform: Target platform (e.g., “linux/amd64”)args: Build argumentstarget: Target build stagecacheFrom: Cache sourcescacheTo: Cache destinationsoptions: Additional Docker build options
Image reference to tag (alternative to build).
Registry credentials for pushing:
username: Registry usernamepassword: Registry password (Secret)server: Registry server URL
Whether to skip pushing the image to registry.Default:
falseReturns
Image name.
Full image reference (name:tag).
Docker image ID.
Repository digest if pushed to registry.
Timestamp when the image was built.
Examples
Build an image from Dockerfile
Build and push to registry
RemoteImage
Pull and reference Docker images from remote registries.Properties
Docker image name (e.g., “nginx”).
Tag for the image (e.g., “latest” or “1.19-alpine”).Default:
"latest"Always attempt to pull the image, even if it exists locally.
Returns
Full image reference (name:tag).
Timestamp when the image was pulled.
Examples
Network
Create and manage Docker networks for container connectivity.Properties
Network name.Default:
${app}-${stage}-${id}Network driver to use.Default:
"bridge"Enable IPv6 on the network.Default:
falseCustom metadata labels for the network.
Returns
Network ID assigned by Docker.
Network name.
Timestamp when the network was created.
Examples
Volume
Create and manage Docker volumes for persistent data storage.Properties
Volume name.Default:
${app}-${stage}-${id}Volume driver to use.Default:
"local"Driver-specific options (e.g., NFS configuration).
Custom metadata labels for the volume.
Whether to adopt the volume if it already exists.Default:
falseReturns
Volume ID (same as name for Docker volumes).
Volume name.
Volume mountpoint path on the host.
Timestamp when the volume was created.