Docker

Pulumi Official
Package maintained by Pulumi
v3.2.0 published on Friday, Apr 1, 2022 by Pulumi

getRegistryImage

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

using Pulumi;
using Docker = Pulumi.Docker;

class MyStack : Stack
{
    public MyStack()
    {
        var ubuntuRegistryImage = Output.Create(Docker.GetRegistryImage.InvokeAsync(new Docker.GetRegistryImageArgs
        {
            Name = "ubuntu:precise",
        }));
        var ubuntuRemoteImage = new Docker.RemoteImage("ubuntuRemoteImage", new Docker.RemoteImageArgs
        {
            Name = ubuntuRegistryImage.Apply(ubuntuRegistryImage => ubuntuRegistryImage.Name),
            PullTriggers = 
            {
                ubuntuRegistryImage.Apply(ubuntuRegistryImage => ubuntuRegistryImage.Sha256Digest),
            },
        });
    }

}
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 {
		ubuntuRegistryImage, err := docker.LookupRegistryImage(ctx, &GetRegistryImageArgs{
			Name: "ubuntu:precise",
		}, nil)
		if err != nil {
			return err
		}
		_, err = docker.NewRemoteImage(ctx, "ubuntuRemoteImage", &docker.RemoteImageArgs{
			Name: pulumi.String(ubuntuRegistryImage.Name),
			PullTriggers: pulumi.StringArray{
				pulumi.String(ubuntuRegistryImage.Sha256Digest),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_docker as docker

ubuntu_registry_image = docker.get_registry_image(name="ubuntu:precise")
ubuntu_remote_image = docker.RemoteImage("ubuntuRemoteImage",
    name=ubuntu_registry_image.name,
    pull_triggers=[ubuntu_registry_image.sha256_digest])
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";

const ubuntuRegistryImage = docker.getRegistryImage({
    name: "ubuntu:precise",
});
const ubuntuRemoteImage = new docker.RemoteImage("ubuntuRemoteImage", {
    name: ubuntuRegistryImage.then(ubuntuRegistryImage => ubuntuRegistryImage.name),
    pullTriggers: [ubuntuRegistryImage.then(ubuntuRegistryImage => ubuntuRegistryImage.sha256Digest)],
});

Coming soon!

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)
// Output-based functions aren't available in Java yet
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

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

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

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

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

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

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

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

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

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

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

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

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
https://github.com/pulumi/pulumi-docker
License
Apache-2.0
Notes

This Pulumi package is based on the docker Terraform Provider.