get Remote Image
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",
});
Content copied to clipboard
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")
Content copied to clipboard
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",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
Return
A collection of values returned by getRemoteImage.
Parameters
argument
A collection of arguments for invoking getRemoteImage.
Return
A collection of values returned by getRemoteImage.
Parameters
name
The name of the Docker image, including any tags or SHA256 repo digests.
See also
suspend fun getRemoteImage(argument: suspend GetRemoteImagePlainArgsBuilder.() -> Unit): GetRemoteImageResult
Return
A collection of values returned by getRemoteImage.
Parameters
argument
Builder for com.pulumi.docker.kotlin.inputs.GetRemoteImagePlainArgs.