RemoteImage

class RemoteImage : KotlinCustomResource

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());
}
}

Properties

Link copied to clipboard
val build: Output<RemoteImageBuild>?

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

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

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageId: Output<String>

The ID of the image (as seen when executing docker inspect on the image). Can be used to reference the image via its ID in other resources.

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

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 latest: Output<String>

The ID of the image in the form of sha256:<hash> image digest. Do not confuse it with the default latest tag.

Link copied to clipboard
val name: Output<String>

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

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

A value which cause an image pull when changed

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

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val repoDigest: Output<String>

The image sha256 digest in the form of repo[:tag]@sha256:<hash>.

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

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

Link copied to clipboard
val urn: Output<String>