1. Packages
  2. Docker
  3. API Docs
  4. RegistryImage
Docker v4.5.3 published on Wednesday, Mar 27, 2024 by Pulumi

docker.RegistryImage

Explore with Pulumi AI

docker logo
Docker v4.5.3 published on Wednesday, Mar 27, 2024 by Pulumi

    Manages the lifecycle of docker image in a registry. You can upload images to a registry (= docker push) and also delete them again

    Example Usage

    Build an image with the docker.RemoteImage resource and then push it to a registry:

    import * as pulumi from "@pulumi/pulumi";
    import * as docker from "@pulumi/docker";
    
    const helloworld = new docker.RegistryImage("helloworld", {keepRemotely: true});
    const image = new docker.RemoteImage("image", {
        name: "registry.com/somename:1.0",
        build: {
            context: `${path.cwd}/absolutePathToContextFolder`,
        },
    });
    
    import pulumi
    import pulumi_docker as docker
    
    helloworld = docker.RegistryImage("helloworld", keep_remotely=True)
    image = docker.RemoteImage("image",
        name="registry.com/somename:1.0",
        build=docker.RemoteImageBuildArgs(
            context=f"{path['cwd']}/absolutePathToContextFolder",
        ))
    
    package main
    
    import (
    	"fmt"
    
    	"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 {
    		_, err := docker.NewRegistryImage(ctx, "helloworld", &docker.RegistryImageArgs{
    			KeepRemotely: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = docker.NewRemoteImage(ctx, "image", &docker.RemoteImageArgs{
    			Name: pulumi.String("registry.com/somename:1.0"),
    			Build: &docker.RemoteImageBuildArgs{
    				Context: pulumi.String(fmt.Sprintf("%v/absolutePathToContextFolder", path.Cwd)),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Docker = Pulumi.Docker;
    
    return await Deployment.RunAsync(() => 
    {
        var helloworld = new Docker.RegistryImage("helloworld", new()
        {
            KeepRemotely = true,
        });
    
        var image = new Docker.RemoteImage("image", new()
        {
            Name = "registry.com/somename:1.0",
            Build = new Docker.Inputs.RemoteImageBuildArgs
            {
                Context = $"{path.Cwd}/absolutePathToContextFolder",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.docker.RegistryImage;
    import com.pulumi.docker.RegistryImageArgs;
    import com.pulumi.docker.RemoteImage;
    import com.pulumi.docker.RemoteImageArgs;
    import com.pulumi.docker.inputs.RemoteImageBuildArgs;
    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 helloworld = new RegistryImage("helloworld", RegistryImageArgs.builder()        
                .keepRemotely(true)
                .build());
    
            var image = new RemoteImage("image", RemoteImageArgs.builder()        
                .name("registry.com/somename:1.0")
                .build(RemoteImageBuildArgs.builder()
                    .context(String.format("%s/absolutePathToContextFolder", path.cwd()))
                    .build())
                .build());
    
        }
    }
    
    resources:
      helloworld:
        type: docker:RegistryImage
        properties:
          keepRemotely: true
      image:
        type: docker:RemoteImage
        properties:
          name: registry.com/somename:1.0
          build:
            context: ${path.cwd}/absolutePathToContextFolder
    

    Create RegistryImage Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RegistryImage(name: string, args?: RegistryImageArgs, opts?: CustomResourceOptions);
    @overload
    def RegistryImage(resource_name: str,
                      args: Optional[RegistryImageArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def RegistryImage(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      insecure_skip_verify: Optional[bool] = None,
                      keep_remotely: Optional[bool] = None,
                      name: Optional[str] = None,
                      triggers: Optional[Mapping[str, Any]] = None)
    func NewRegistryImage(ctx *Context, name string, args *RegistryImageArgs, opts ...ResourceOption) (*RegistryImage, error)
    public RegistryImage(string name, RegistryImageArgs? args = null, CustomResourceOptions? opts = null)
    public RegistryImage(String name, RegistryImageArgs args)
    public RegistryImage(String name, RegistryImageArgs args, CustomResourceOptions options)
    
    type: docker:RegistryImage
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args RegistryImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RegistryImageArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RegistryImageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RegistryImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RegistryImageArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var registryImageResource = new Docker.RegistryImage("registryImageResource", new()
    {
        InsecureSkipVerify = false,
        KeepRemotely = false,
        Name = "string",
        Triggers = 
        {
            { "string", "any" },
        },
    });
    
    example, err := docker.NewRegistryImage(ctx, "registryImageResource", &docker.RegistryImageArgs{
    	InsecureSkipVerify: pulumi.Bool(false),
    	KeepRemotely:       pulumi.Bool(false),
    	Name:               pulumi.String("string"),
    	Triggers: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var registryImageResource = new RegistryImage("registryImageResource", RegistryImageArgs.builder()        
        .insecureSkipVerify(false)
        .keepRemotely(false)
        .name("string")
        .triggers(Map.of("string", "any"))
        .build());
    
    registry_image_resource = docker.RegistryImage("registryImageResource",
        insecure_skip_verify=False,
        keep_remotely=False,
        name="string",
        triggers={
            "string": "any",
        })
    
    const registryImageResource = new docker.RegistryImage("registryImageResource", {
        insecureSkipVerify: false,
        keepRemotely: false,
        name: "string",
        triggers: {
            string: "any",
        },
    });
    
    type: docker:RegistryImage
    properties:
        insecureSkipVerify: false
        keepRemotely: false
        name: string
        triggers:
            string: any
    

    RegistryImage Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The RegistryImage resource accepts the following input properties:

    InsecureSkipVerify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    KeepRemotely bool
    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 registry on destroy operation. Defaults to false
    Name string
    The name of the Docker image.
    Triggers Dictionary<string, object>
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    InsecureSkipVerify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    KeepRemotely bool
    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 registry on destroy operation. Defaults to false
    Name string
    The name of the Docker image.
    Triggers map[string]interface{}
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    insecureSkipVerify Boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    keepRemotely 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 registry on destroy operation. Defaults to false
    name String
    The name of the Docker image.
    triggers Map<String,Object>
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    insecureSkipVerify boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    keepRemotely 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 registry on destroy operation. Defaults to false
    name string
    The name of the Docker image.
    triggers {[key: string]: any}
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    insecure_skip_verify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    keep_remotely bool
    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 registry on destroy operation. Defaults to false
    name str
    The name of the Docker image.
    triggers Mapping[str, Any]
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    insecureSkipVerify Boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    keepRemotely 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 registry on destroy operation. Defaults to false
    name String
    The name of the Docker image.
    triggers Map<Any>
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RegistryImage resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Sha256Digest string
    The sha256 digest of the image.
    Id string
    The provider-assigned unique ID for this managed resource.
    Sha256Digest string
    The sha256 digest of the image.
    id String
    The provider-assigned unique ID for this managed resource.
    sha256Digest String
    The sha256 digest of the image.
    id string
    The provider-assigned unique ID for this managed resource.
    sha256Digest string
    The sha256 digest of the image.
    id str
    The provider-assigned unique ID for this managed resource.
    sha256_digest str
    The sha256 digest of the image.
    id String
    The provider-assigned unique ID for this managed resource.
    sha256Digest String
    The sha256 digest of the image.

    Look up Existing RegistryImage Resource

    Get an existing RegistryImage resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RegistryImageState, opts?: CustomResourceOptions): RegistryImage
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            insecure_skip_verify: Optional[bool] = None,
            keep_remotely: Optional[bool] = None,
            name: Optional[str] = None,
            sha256_digest: Optional[str] = None,
            triggers: Optional[Mapping[str, Any]] = None) -> RegistryImage
    func GetRegistryImage(ctx *Context, name string, id IDInput, state *RegistryImageState, opts ...ResourceOption) (*RegistryImage, error)
    public static RegistryImage Get(string name, Input<string> id, RegistryImageState? state, CustomResourceOptions? opts = null)
    public static RegistryImage get(String name, Output<String> id, RegistryImageState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    InsecureSkipVerify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    KeepRemotely bool
    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 registry on destroy operation. Defaults to false
    Name string
    The name of the Docker image.
    Sha256Digest string
    The sha256 digest of the image.
    Triggers Dictionary<string, object>
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    InsecureSkipVerify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    KeepRemotely bool
    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 registry on destroy operation. Defaults to false
    Name string
    The name of the Docker image.
    Sha256Digest string
    The sha256 digest of the image.
    Triggers map[string]interface{}
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    insecureSkipVerify Boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    keepRemotely 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 registry on destroy operation. Defaults to false
    name String
    The name of the Docker image.
    sha256Digest String
    The sha256 digest of the image.
    triggers Map<String,Object>
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    insecureSkipVerify boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    keepRemotely 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 registry on destroy operation. Defaults to false
    name string
    The name of the Docker image.
    sha256Digest string
    The sha256 digest of the image.
    triggers {[key: string]: any}
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    insecure_skip_verify bool
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    keep_remotely bool
    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 registry on destroy operation. Defaults to false
    name str
    The name of the Docker image.
    sha256_digest str
    The sha256 digest of the image.
    triggers Mapping[str, Any]
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image
    insecureSkipVerify Boolean
    If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
    keepRemotely 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 registry on destroy operation. Defaults to false
    name String
    The name of the Docker image.
    sha256Digest String
    The sha256 digest of the image.
    triggers Map<Any>
    A map of arbitrary strings that, when changed, will force the docker.RegistryImage resource to be replaced. This can be used to repush a local image

    Package Details

    Repository
    Docker pulumi/pulumi-docker
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the docker Terraform Provider.
    docker logo
    Docker v4.5.3 published on Wednesday, Mar 27, 2024 by Pulumi