1. Packages
  2. Docker Provider
  3. API Docs
  4. getRegistryImage
Docker v4.9.0 published on Friday, Sep 26, 2025 by Pulumi

docker.getRegistryImage

Start a Neo task
Explain and create a docker.getRegistryImage resource
docker logo
Docker v4.9.0 published on Friday, Sep 26, 2025 by Pulumi

    Reads the image metadata from a Docker Registry. Used in conjunction with the docker.RemoteImage resource to keep an image up to date on the latest available version of the tag.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as docker from "@pulumi/docker";
    
    const ubuntu = docker.getRegistryImage({
        name: "ubuntu:precise",
    });
    const ubuntuRemoteImage = new docker.RemoteImage("ubuntu", {
        name: ubuntu.then(ubuntu => ubuntu.name),
        pullTriggers: [ubuntu.then(ubuntu => ubuntu.sha256Digest)],
    });
    
    import pulumi
    import pulumi_docker as docker
    
    ubuntu = docker.get_registry_image(name="ubuntu:precise")
    ubuntu_remote_image = docker.RemoteImage("ubuntu",
        name=ubuntu.name,
        pull_triggers=[ubuntu.sha256_digest])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-docker/sdk/v4/go/docker"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ubuntu, err := docker.LookupRegistryImage(ctx, &docker.LookupRegistryImageArgs{
    			Name: "ubuntu:precise",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = docker.NewRemoteImage(ctx, "ubuntu", &docker.RemoteImageArgs{
    			Name: pulumi.String(ubuntu.Name),
    			PullTriggers: pulumi.StringArray{
    				pulumi.String(ubuntu.Sha256Digest),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Docker = Pulumi.Docker;
    
    return await Deployment.RunAsync(() => 
    {
        var ubuntu = Docker.GetRegistryImage.Invoke(new()
        {
            Name = "ubuntu:precise",
        });
    
        var ubuntuRemoteImage = new Docker.RemoteImage("ubuntu", new()
        {
            Name = ubuntu.Apply(getRegistryImageResult => getRegistryImageResult.Name),
            PullTriggers = new[]
            {
                ubuntu.Apply(getRegistryImageResult => getRegistryImageResult.Sha256Digest),
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.docker.DockerFunctions;
    import com.pulumi.docker.inputs.GetRegistryImageArgs;
    import com.pulumi.docker.RemoteImage;
    import com.pulumi.docker.RemoteImageArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var ubuntu = DockerFunctions.getRegistryImage(GetRegistryImageArgs.builder()
                .name("ubuntu:precise")
                .build());
    
            var ubuntuRemoteImage = new RemoteImage("ubuntuRemoteImage", RemoteImageArgs.builder()
                .name(ubuntu.name())
                .pullTriggers(ubuntu.sha256Digest())
                .build());
    
        }
    }
    
    resources:
      ubuntuRemoteImage:
        type: docker:RemoteImage
        name: ubuntu
        properties:
          name: ${ubuntu.name}
          pullTriggers:
            - ${ubuntu.sha256Digest}
    variables:
      ubuntu:
        fn::invoke:
          function: docker:getRegistryImage
          arguments:
            name: ubuntu:precise
    

    Using getRegistryImage

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRegistryImage(args: GetRegistryImageArgs, opts?: InvokeOptions): Promise<GetRegistryImageResult>
    function getRegistryImageOutput(args: GetRegistryImageOutputArgs, opts?: InvokeOptions): Output<GetRegistryImageResult>
    def get_registry_image(insecure_skip_verify: Optional[bool] = None,
                           name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetRegistryImageResult
    def get_registry_image_output(insecure_skip_verify: Optional[pulumi.Input[bool]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetRegistryImageResult]
    func LookupRegistryImage(ctx *Context, args *LookupRegistryImageArgs, opts ...InvokeOption) (*LookupRegistryImageResult, error)
    func LookupRegistryImageOutput(ctx *Context, args *LookupRegistryImageOutputArgs, opts ...InvokeOption) LookupRegistryImageResultOutput

    > Note: This function is named LookupRegistryImage in the Go SDK.

    public static class GetRegistryImage 
    {
        public static Task<GetRegistryImageResult> InvokeAsync(GetRegistryImageArgs args, InvokeOptions? opts = null)
        public static Output<GetRegistryImageResult> Invoke(GetRegistryImageInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRegistryImageResult> getRegistryImage(GetRegistryImageArgs args, InvokeOptions options)
    public static Output<GetRegistryImageResult> getRegistryImage(GetRegistryImageArgs args, InvokeOptions options)
    
    fn::invoke:
      function: docker:index/getRegistryImage:getRegistryImage
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    InsecureSkipVerify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    Name string
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    InsecureSkipVerify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    name String
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    insecureSkipVerify Boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    name string
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    insecureSkipVerify boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    name str
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    insecure_skip_verify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    name String
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    insecureSkipVerify Boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false

    getRegistryImage Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    Sha256Digest string
    The content digest of the image, as stored in the registry.
    InsecureSkipVerify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    Sha256Digest string
    The content digest of the image, as stored in the registry.
    InsecureSkipVerify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    sha256Digest String
    The content digest of the image, as stored in the registry.
    insecureSkipVerify Boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    sha256Digest string
    The content digest of the image, as stored in the registry.
    insecureSkipVerify boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    sha256_digest str
    The content digest of the image, as stored in the registry.
    insecure_skip_verify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the Docker image, including any tags. e.g. alpine:latest. You can also specify a digest, e.g. nginx:1.28.0@sha256:eaa7e36decc3421fc04478c586dfea0d931cebe47d5bc0b15d758a32ba51126f.
    sha256Digest String
    The content digest of the image, as stored in the registry.
    insecureSkipVerify Boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false

    Package Details

    Repository
    Docker pulumi/pulumi-docker
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the docker Terraform Provider.
    docker logo
    Docker v4.9.0 published on Friday, Sep 26, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate