Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

RegistryImage

Manages the lifecycle of docker image/tag in a registry.

Schema

Required

  • name (String) The name of the Docker image.

Optional

  • build (Block List, Max: 1) Definition for building the image (see below for nested schema)
  • id (String) The ID of this resource.
  • insecure_skip_verify (Boolean) If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
  • keep_remotely (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

Read-Only

  • sha256_digest (String) The sha256 digest of the image.

Nested Schema for build

Required:

  • context (String) The absolute path to the context folder. You can use the helper function ‘${path.cwd}/context-dir’.

Optional:

  • auth_config (Block List) The configuration for the authentication (see below for nested schema)
  • build_args (Map of String) Pairs for build-time variables in the form TODO
  • build_id (String) BuildID is an optional identifier that can be passed together with the build request. The
  • cache_from (List of String) Images to consider as cache sources
  • cgroup_parent (String) Optional parent cgroup for the container
  • cpu_period (Number) The length of a CPU period in microseconds
  • cpu_quota (Number) Microseconds of CPU time that the container can get in a CPU period
  • cpu_set_cpus (String) CPUs in which to allow execution (e.g., 0-3, 0, 1)
  • cpu_set_mems (String) MEMs in which to allow execution (0-3, 0, 1)
  • cpu_shares (Number) CPU shares (relative weight)
  • dockerfile (String) Dockerfile file. Defaults to Dockerfile
  • extra_hosts (List of String) A list of hostnames/IP mappings to add to the container’s /etc/hosts file. Specified in the form [“hostname:IP”]
  • force_remove (Boolean) Always remove intermediate containers
  • isolation (String) Isolation represents the isolation technology of a container. The supported values are
  • labels (Map of String) User-defined key/value metadata
  • memory (Number) Set memory limit for build
  • memory_swap (Number) Total memory (memory + swap), -1 to enable unlimited swap
  • network_mode (String) Set the networking mode for the RUN instructions during build
  • no_cache (Boolean) Do not use the cache when building the image
  • platform (String) Set platform if server is multi-platform capable
  • pull_parent (Boolean) Attempt to pull the image even if an older image exists locally
  • remote_context (String) A Git repository URI or HTTP/HTTPS context URI
  • remove (Boolean) Remove intermediate containers after a successful build (default behavior)
  • security_opt (List of String) The security options
  • session_id (String) Set an ID for the build session
  • shm_size (Number) Size of /dev/shm in bytes. The size must be greater than 0
  • squash (Boolean) If true the new layers are squashed into a new image with a single new layer
  • suppress_output (Boolean) Suppress the build output and print image ID on success
  • target (String) Set the target build stage to build
  • ulimit (Block List) Configuration for ulimits (see below for nested schema)
  • version (String) Version of the unerlying builder to use

Nested Schema for build.auth_config

Required:

  • host_name (String) hostname of the registry

Optional:

  • auth (String) the auth token
  • email (String) the user emal
  • identity_token (String) the identity token
  • password (String) the registry password
  • registry_token (String) the registry token
  • server_address (String) the server address
  • user_name (String) the registry user name

Nested Schema for build.ulimit

Required:

  • hard (Number) soft limit
  • name (String) type of ulimit, e.g. nofile
  • soft (Number) hard limit

Example Usage

using Pulumi;
using Docker = Pulumi.Docker;

class MyStack : Stack
{
    public MyStack()
    {
        var helloworld = new Docker.RegistryImage("helloworld", new Docker.RegistryImageArgs
        {
            Build = new Docker.Inputs.RegistryImageBuildArgs
            {
                Context = $"{path.Cwd}/absolutePathToContextFolder",
            },
        });
    }

}
package main

import (
	"fmt"

	"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 {
		_, err := docker.NewRegistryImage(ctx, "helloworld", &docker.RegistryImageArgs{
			Build: &docker.RegistryImageBuildArgs{
				Context: pulumi.String(fmt.Sprintf("%v%v", path.Cwd, "/absolutePathToContextFolder")),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_docker as docker

helloworld = docker.RegistryImage("helloworld", build=docker.RegistryImageBuildArgs(
    context=f"{path['cwd']}/absolutePathToContextFolder",
))
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";
import * as process from "process";

const helloworld = new docker.RegistryImage("helloworld", {
    build: {
        context: `${process.cwd()}/absolutePathToContextFolder`,
    },
});

Create a RegistryImage Resource

new RegistryImage(name: string, args?: RegistryImageArgs, opts?: CustomResourceOptions);
@overload
def RegistryImage(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  build: Optional[RegistryImageBuildArgs] = None,
                  insecure_skip_verify: Optional[bool] = None,
                  keep_remotely: Optional[bool] = None,
                  name: Optional[str] = None)
@overload
def RegistryImage(resource_name: str,
                  args: Optional[RegistryImageArgs] = None,
                  opts: Optional[ResourceOptions] = None)
func NewRegistryImage(ctx *Context, name string, args *RegistryImageArgs, opts ...ResourceOption) (*RegistryImage, error)
public RegistryImage(string name, RegistryImageArgs? args = null, CustomResourceOptions? opts = null)
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.

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:

Build RegistryImageBuildArgs
Definition for building the 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.
Build RegistryImageBuildArgs
Definition for building the 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.
build RegistryImageBuildArgs
Definition for building the 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.
build RegistryImageBuildArgs
Definition for building the 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.

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 str
The provider-assigned unique ID for this managed resource.
sha256_digest str
The sha256 digest of the image.

Look up an 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,
        build: Optional[RegistryImageBuildArgs] = None,
        insecure_skip_verify: Optional[bool] = None,
        keep_remotely: Optional[bool] = None,
        name: Optional[str] = None,
        sha256_digest: Optional[str] = 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)
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.

The following state arguments are supported:

Build RegistryImageBuildArgs
Definition for building the 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.
Build RegistryImageBuildArgs
Definition for building the 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.
build RegistryImageBuildArgs
Definition for building the 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.
build RegistryImageBuildArgs
Definition for building the 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.

Supporting Types

RegistryImageBuild

Context string
AuthConfigs List<RegistryImageBuildAuthConfig>
BuildArgs Dictionary<string, string>
BuildId string
CacheFroms List<string>
CgroupParent string
CpuPeriod int
CpuQuota int
CpuSetCpus string
CpuSetMems string
CpuShares int
Dockerfile string
ExtraHosts List<string>
ForceRemove bool
Isolation string
Labels Dictionary<string, string>
Memory int
MemorySwap int
NetworkMode string
NoCache bool
Platform string
PullParent bool
RemoteContext string
Remove bool
SecurityOpts List<string>
SessionId string
ShmSize int
Squash bool
SuppressOutput bool
Target string
Ulimits List<RegistryImageBuildUlimit>
Version string
context string
authConfigs RegistryImageBuildAuthConfig[]
buildArgs {[key: string]: string}
buildId string
cacheFroms string[]
cgroupParent string
cpuPeriod number
cpuQuota number
cpuSetCpus string
cpuSetMems string
cpuShares number
dockerfile string
extraHosts string[]
forceRemove boolean
isolation string
labels {[key: string]: string}
memory number
memorySwap number
networkMode string
noCache boolean
platform string
pullParent boolean
remoteContext string
remove boolean
securityOpts string[]
sessionId string
shmSize number
squash boolean
suppressOutput boolean
target string
ulimits RegistryImageBuildUlimit[]
version string

RegistryImageBuildAuthConfig

HostName string
Auth string
Email string
IdentityToken string
Password string
RegistryToken string
ServerAddress string
UserName string
HostName string
Auth string
Email string
IdentityToken string
Password string
RegistryToken string
ServerAddress string
UserName string
hostName string
auth string
email string
identityToken string
password string
registryToken string
serverAddress string
userName string

RegistryImageBuildUlimit

Hard int
Name string
Soft int
Hard int
Name string
Soft int
hard number
name string
soft number
hard int
name str
soft int

Package Details

Repository
https://github.com/pulumi/pulumi-docker
License
Apache-2.0
Notes
This Pulumi package is based on the docker Terraform Provider.