1. Packages
  2. Docker Provider
  3. API Docs
  4. getRemoteImage
Docker v4.5.6 published on Tuesday, Sep 24, 2024 by Pulumi

docker.getRemoteImage

Explore with Pulumi AI

docker logo
Docker v4.5.6 published on Tuesday, Sep 24, 2024 by Pulumi

    docker.RemoteImage provides details about a specific Docker Image which needs to be present on the Docker Host

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as docker from "@pulumi/docker";
    
    // uses the 'latest' tag
    const latest = docker.getRemoteImage({
        name: "nginx",
    });
    // uses a specific tag
    const specific = docker.getRemoteImage({
        name: "nginx:1.17.6",
    });
    // use the image digest
    const digest = docker.getRemoteImage({
        name: "nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
    });
    // uses the tag and the image digest
    const tagAndDigest = docker.getRemoteImage({
        name: "nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
    });
    
    import pulumi
    import pulumi_docker as docker
    
    # uses the 'latest' tag
    latest = docker.get_remote_image(name="nginx")
    # uses a specific tag
    specific = docker.get_remote_image(name="nginx:1.17.6")
    # use the image digest
    digest = docker.get_remote_image(name="nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
    # uses the tag and the image digest
    tag_and_digest = docker.get_remote_image(name="nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
    
    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 {
    		// uses the 'latest' tag
    		_, err := docker.LookupRemoteImage(ctx, &docker.LookupRemoteImageArgs{
    			Name: "nginx",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// uses a specific tag
    		_, err = docker.LookupRemoteImage(ctx, &docker.LookupRemoteImageArgs{
    			Name: "nginx:1.17.6",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// use the image digest
    		_, err = docker.LookupRemoteImage(ctx, &docker.LookupRemoteImageArgs{
    			Name: "nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// uses the tag and the image digest
    		_, err = docker.LookupRemoteImage(ctx, &docker.LookupRemoteImageArgs{
    			Name: "nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Docker = Pulumi.Docker;
    
    return await Deployment.RunAsync(() => 
    {
        // uses the 'latest' tag
        var latest = Docker.GetRemoteImage.Invoke(new()
        {
            Name = "nginx",
        });
    
        // uses a specific tag
        var specific = Docker.GetRemoteImage.Invoke(new()
        {
            Name = "nginx:1.17.6",
        });
    
        // use the image digest
        var digest = Docker.GetRemoteImage.Invoke(new()
        {
            Name = "nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
        });
    
        // uses the tag and the image digest
        var tagAndDigest = Docker.GetRemoteImage.Invoke(new()
        {
            Name = "nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
        });
    
    });
    
    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.GetRemoteImageArgs;
    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) {
            // uses the 'latest' tag
            final var latest = DockerFunctions.getRemoteImage(GetRemoteImageArgs.builder()
                .name("nginx")
                .build());
    
            // uses a specific tag
            final var specific = DockerFunctions.getRemoteImage(GetRemoteImageArgs.builder()
                .name("nginx:1.17.6")
                .build());
    
            // use the image digest
            final var digest = DockerFunctions.getRemoteImage(GetRemoteImageArgs.builder()
                .name("nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
                .build());
    
            // uses the tag and the image digest
            final var tagAndDigest = DockerFunctions.getRemoteImage(GetRemoteImageArgs.builder()
                .name("nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
                .build());
    
        }
    }
    
    variables:
      # uses the 'latest' tag
      latest:
        fn::invoke:
          Function: docker:getRemoteImage
          Arguments:
            name: nginx
      # uses a specific tag
      specific:
        fn::invoke:
          Function: docker:getRemoteImage
          Arguments:
            name: nginx:1.17.6
      # use the image digest
      digest:
        fn::invoke:
          Function: docker:getRemoteImage
          Arguments:
            name: nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2
      # uses the tag and the image digest
      tagAndDigest:
        fn::invoke:
          Function: docker:getRemoteImage
          Arguments:
            name: nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2
    

    Using getRemoteImage

    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 getRemoteImage(args: GetRemoteImageArgs, opts?: InvokeOptions): Promise<GetRemoteImageResult>
    function getRemoteImageOutput(args: GetRemoteImageOutputArgs, opts?: InvokeOptions): Output<GetRemoteImageResult>
    def get_remote_image(name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetRemoteImageResult
    def get_remote_image_output(name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetRemoteImageResult]
    func LookupRemoteImage(ctx *Context, args *LookupRemoteImageArgs, opts ...InvokeOption) (*LookupRemoteImageResult, error)
    func LookupRemoteImageOutput(ctx *Context, args *LookupRemoteImageOutputArgs, opts ...InvokeOption) LookupRemoteImageResultOutput

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

    public static class GetRemoteImage 
    {
        public static Task<GetRemoteImageResult> InvokeAsync(GetRemoteImageArgs args, InvokeOptions? opts = null)
        public static Output<GetRemoteImageResult> Invoke(GetRemoteImageInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRemoteImageResult> getRemoteImage(GetRemoteImageArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: docker:index/getRemoteImage:getRemoteImage
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Docker image, including any tags or SHA256 repo digests.
    Name string
    The name of the Docker image, including any tags or SHA256 repo digests.
    name String
    The name of the Docker image, including any tags or SHA256 repo digests.
    name string
    The name of the Docker image, including any tags or SHA256 repo digests.
    name str
    The name of the Docker image, including any tags or SHA256 repo digests.
    name String
    The name of the Docker image, including any tags or SHA256 repo digests.

    getRemoteImage 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 or SHA256 repo digests.
    RepoDigest string
    The image sha256 digest in the form of repo[:tag]@sha256:<hash>. It may be empty in the edge case where the local image was pulled from a repo, tagged locally, and then referred to in the data source by that local name/tag.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the Docker image, including any tags or SHA256 repo digests.
    RepoDigest string
    The image sha256 digest in the form of repo[:tag]@sha256:<hash>. It may be empty in the edge case where the local image was pulled from a repo, tagged locally, and then referred to in the data source by that local name/tag.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the Docker image, including any tags or SHA256 repo digests.
    repoDigest String
    The image sha256 digest in the form of repo[:tag]@sha256:<hash>. It may be empty in the edge case where the local image was pulled from a repo, tagged locally, and then referred to in the data source by that local name/tag.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the Docker image, including any tags or SHA256 repo digests.
    repoDigest string
    The image sha256 digest in the form of repo[:tag]@sha256:<hash>. It may be empty in the edge case where the local image was pulled from a repo, tagged locally, and then referred to in the data source by that local name/tag.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the Docker image, including any tags or SHA256 repo digests.
    repo_digest str
    The image sha256 digest in the form of repo[:tag]@sha256:<hash>. It may be empty in the edge case where the local image was pulled from a repo, tagged locally, and then referred to in the data source by that local name/tag.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the Docker image, including any tags or SHA256 repo digests.
    repoDigest String
    The image sha256 digest in the form of repo[:tag]@sha256:<hash>. It may be empty in the edge case where the local image was pulled from a repo, tagged locally, and then referred to in the data source by that local name/tag.

    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.5.6 published on Tuesday, Sep 24, 2024 by Pulumi