RemoteImageArgs

data class RemoteImageArgs(val build: Output<RemoteImageBuildArgs>? = null, val forceRemove: Output<Boolean>? = null, val keepLocally: Output<Boolean>? = null, val name: Output<String>? = null, val pullTrigger: Output<String>? = null, val pullTriggers: Output<List<String>>? = null, val triggers: Output<Map<String, Any>>? = null) : ConvertibleToJava<RemoteImageArgs>

Pulls a Docker image to a given Docker host from a Docker Registry. This resource will not pull new layers of the image automatically unless used in conjunction with docker.RegistryImage data source to update the pull_triggers field.

Example Usage

Basic

Finds and downloads the latest ubuntu:precise image but does not check for further updates of the image

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
var ubuntu = new RemoteImage("ubuntu", RemoteImageArgs.builder()
.name("ubuntu:precise")
.build());
}
}

Dynamic updates

To be able to update an image dynamically when the sha256 sum changes, you need to use it in combination with docker.RegistryImage as follows:

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 ubuntuRegistryImage = DockerFunctions.getRegistryImage(GetRegistryImageArgs.builder()
.name("ubuntu:precise")
.build());
var ubuntuRemoteImage = new RemoteImage("ubuntuRemoteImage", RemoteImageArgs.builder()
.name(ubuntuRegistryImage.applyValue(getRegistryImageResult -> getRegistryImageResult.name()))
.pullTriggers(ubuntuRegistryImage.applyValue(getRegistryImageResult -> getRegistryImageResult.sha256Digest()))
.build());
}
}

Constructors

Link copied to clipboard
constructor(build: Output<RemoteImageBuildArgs>? = null, forceRemove: Output<Boolean>? = null, keepLocally: Output<Boolean>? = null, name: Output<String>? = null, pullTrigger: Output<String>? = null, pullTriggers: Output<List<String>>? = null, triggers: Output<Map<String, Any>>? = null)

Properties

Link copied to clipboard
val build: Output<RemoteImageBuildArgs>? = null

Configuration to build an image. Please see docker build command reference too.

Link copied to clipboard
val forceRemove: Output<Boolean>? = null

If true, then the image is removed forcibly when the resource is destroyed.

Link copied to clipboard
val keepLocally: Output<Boolean>? = null

If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker local storage on destroy operation.

Link copied to clipboard
val name: Output<String>? = null

The name of the Docker image, including any tags or SHA256 repo digests.

Link copied to clipboard
val pullTrigger: Output<String>? = null

A value which cause an image pull when changed

Link copied to clipboard
val pullTriggers: Output<List<String>>? = null

List of values which cause an image pull when changed. This is used to store the image digest from the registry when using the dockerregistryimage.

Link copied to clipboard
val triggers: Output<Map<String, Any>>? = null

A map of arbitrary strings that, when changed, will force the docker.RemoteImage resource to be replaced. This can be used to rebuild an image when contents of source code folders change

Functions

Link copied to clipboard
open override fun toJava(): RemoteImageArgs