Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

getRemoteImage

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

Schema

Required

  • name (String) The name of the Docker image, including any tags or SHA256 repo digests.

Optional

  • id (String) The ID of this resource.

Read-Only

  • repo_digest (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.

Example Usage

using Pulumi;
using Docker = Pulumi.Docker;

class MyStack : Stack
{
    public MyStack()
    {
        var latest = Output.Create(Docker.GetRemoteImage.InvokeAsync(new Docker.GetRemoteImageArgs
        {
            Name = "nginx",
        }));
        var specific = Output.Create(Docker.GetRemoteImage.InvokeAsync(new Docker.GetRemoteImageArgs
        {
            Name = "nginx:1.17.6",
        }));
        var digest = Output.Create(Docker.GetRemoteImage.InvokeAsync(new Docker.GetRemoteImageArgs
        {
            Name = "nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
        }));
        var tagAndDigest = Output.Create(Docker.GetRemoteImage.InvokeAsync(new Docker.GetRemoteImageArgs
        {
            Name = "nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-docker/sdk/v3/go/docker"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := docker.LookupRemoteImage(ctx, &docker.LookupRemoteImageArgs{
			Name: "nginx",
		}, nil)
		if err != nil {
			return err
		}
		_, err = docker.LookupRemoteImage(ctx, &docker.LookupRemoteImageArgs{
			Name: "nginx:1.17.6",
		}, nil)
		if err != nil {
			return err
		}
		_, err = docker.LookupRemoteImage(ctx, &docker.LookupRemoteImageArgs{
			Name: "nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
		}, nil)
		if err != nil {
			return err
		}
		_, err = docker.LookupRemoteImage(ctx, &docker.LookupRemoteImageArgs{
			Name: "nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_docker as docker

latest = docker.get_remote_image(name="nginx")
specific = docker.get_remote_image(name="nginx:1.17.6")
digest = docker.get_remote_image(name="nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
tag_and_digest = docker.get_remote_image(name="nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";

// uses the 'latest' tag
const latest = pulumi.output(docker.getRemoteImage({
    name: "nginx",
}, { async: true }));
// uses a specific tag
const specific = pulumi.output(docker.getRemoteImage({
    name: "nginx:1.17.6",
}, { async: true }));
// use the image digest
const digest = pulumi.output(docker.getRemoteImage({
    name: "nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
}, { async: true }));
// uses the tag and the image digest
const tagAndDigest = pulumi.output(docker.getRemoteImage({
    name: "nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2",
}, { async: true }));

Using getRemoteImage

function getRemoteImage(args: GetRemoteImageArgs, opts?: InvokeOptions): Promise<GetRemoteImageResult>
def get_remote_image(name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetRemoteImageResult
func LookupRemoteImage(ctx *Context, args *LookupRemoteImageArgs, opts ...InvokeOption) (*LookupRemoteImageResult, error)

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

public static class GetRemoteImage {
    public static Task<GetRemoteImageResult> InvokeAsync(GetRemoteImageArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string
Name string
name string
name str

getRemoteImage Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
RepoDigest string
Id string
The provider-assigned unique ID for this managed resource.
Name string
RepoDigest string
id string
The provider-assigned unique ID for this managed resource.
name string
repoDigest string
id str
The provider-assigned unique ID for this managed resource.
name str
repo_digest str

Package Details

Repository
https://github.com/pulumi/pulumi-docker
License
Apache-2.0
Notes
This Pulumi package is based on the docker Terraform Provider.