Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

RegistryImage

Provides an image/tag in a Docker registry.

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 = "pathToContextFolder",
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-docker/sdk/v2/go/docker"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := docker.NewRegistryImage(ctx, "helloworld", &docker.RegistryImageArgs{
            Build: &docker.RegistryImageBuildArgs{
                Context: pulumi.String("pathToContextFolder"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_docker as docker

helloworld = docker.RegistryImage("helloworld", build=docker.RegistryImageBuildArgs(
    context="pathToContextFolder",
))
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";

const helloworld = new docker.RegistryImage("helloworld", {
    build: {
        context: "pathToContextFolder",
    },
});

Create a RegistryImage Resource

new RegistryImage(name: string, args?: RegistryImageArgs, opts?: CustomResourceOptions);
def RegistryImage(resource_name: str, opts: Optional[ResourceOptions] = None, build: Optional[RegistryImageBuildArgs] = None, keep_remotely: Optional[bool] = None, name: Optional[str] = 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.
opts ResourceOptions
A bag of options that control this 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 Programming Model docs.

Inputs

The RegistryImage resource accepts the following input properties:

Build RegistryImageBuildArgs

See Build below for details.

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.

Name string

type of ulimit, e.g. nofile

Build RegistryImageBuild

See Build below for details.

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.

Name string

type of ulimit, e.g. nofile

build RegistryImageBuild

See Build below for details.

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.

name string

type of ulimit, e.g. nofile

build RegistryImageBuildArgs

See Build below for details.

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.

name str

type of ulimit, e.g. nofile

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
Id string
The provider-assigned unique ID for this managed resource.
Sha256Digest string
id string
The provider-assigned unique ID for this managed resource.
sha256Digest string
id str
The provider-assigned unique ID for this managed resource.
sha256_digest str

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, 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

See Build below for details.

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.

Name string

type of ulimit, e.g. nofile

Sha256Digest string
Build RegistryImageBuild

See Build below for details.

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.

Name string

type of ulimit, e.g. nofile

Sha256Digest string
build RegistryImageBuild

See Build below for details.

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.

name string

type of ulimit, e.g. nofile

sha256Digest string
build RegistryImageBuildArgs

See Build below for details.

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.

name str

type of ulimit, e.g. nofile

sha256_digest str

Supporting Types

RegistryImageBuild

Context string
  • The path to the context folder
AuthConfigs List<RegistryImageBuildAuthConfigArgs>
  • See AuthConfig below for details
BuildArgs Dictionary<string, string>

string pairs for build-time variables

BuildId string
  • BuildID is an optional identifier that can be passed together with the build request. The same identifier can be used to gracefully cancel the build with the cancel request
CacheFroms List<string>
  • Images to consider as cache sources
CgroupParent string
  • Optional parent cgroup for the container
CpuPeriod int
  • The length of a CPU period in microseconds
CpuQuota int
  • Microseconds of CPU time that the container can get in a CPU period
CpuSetCpus string
  • CPUs in which to allow execution (e.g., 0-3, 0,1)
CpuSetMems string
  • MEMs in which to allow execution (0-3, 0,1)
CpuShares int
  • CPU shares (relative weight)
Dockerfile string
  • Dockerfile file. Default is “Dockerfile”
ExtraHosts List<string>
  • A list of hostnames/IP mappings to add to the container’s /etc/hosts file. Specified in the form [“hostname:IP”]
ForceRemove bool
  • Always remove intermediate containers
Isolation string
  • Isolation represents the isolation technology of a container. The supported values are platform specific
Labels Dictionary<string, string>

string pairs for labels

Memory int
  • Set memory limit for build
MemorySwap int
  • Total memory (memory + swap), -1 to enable unlimited swap
NetworkMode string
  • Set the networking mode for the RUN instructions during build
NoCache bool
  • Do not use the cache when building the image
Platform string
  • Set platform if server is multi-platform capable
PullParent bool
  • Attempt to pull the image even if an older image exists locally
RemoteContext string
  • A Git repository URI or HTTP/HTTPS context URI
Remove bool
  • Remove intermediate containers after a successful build (default behavior)
SecurityOpts List<string>
  • Security options
SessionId string
ShmSize int
  • Size of /dev/shm in bytes. The size must be greater than 0
Squash bool
  • squash the new layers into a new image with a single new layer
SuppressOutput bool
  • Suppress the build output and print image ID on success
Target string
  • Set the target build stage to build
Ulimits List<RegistryImageBuildUlimitArgs>
  • See Ulimit below for details
Version string
  • Version of the unerlying builder to use
Context string
  • The path to the context folder
AuthConfigs []RegistryImageBuildAuthConfig
  • See AuthConfig below for details
BuildArgs map[string]string

string pairs for build-time variables

BuildId string
  • BuildID is an optional identifier that can be passed together with the build request. The same identifier can be used to gracefully cancel the build with the cancel request
CacheFroms []string
  • Images to consider as cache sources
CgroupParent string
  • Optional parent cgroup for the container
CpuPeriod int
  • The length of a CPU period in microseconds
CpuQuota int
  • Microseconds of CPU time that the container can get in a CPU period
CpuSetCpus string
  • CPUs in which to allow execution (e.g., 0-3, 0,1)
CpuSetMems string
  • MEMs in which to allow execution (0-3, 0,1)
CpuShares int
  • CPU shares (relative weight)
Dockerfile string
  • Dockerfile file. Default is “Dockerfile”
ExtraHosts []string
  • A list of hostnames/IP mappings to add to the container’s /etc/hosts file. Specified in the form [“hostname:IP”]
ForceRemove bool
  • Always remove intermediate containers
Isolation string
  • Isolation represents the isolation technology of a container. The supported values are platform specific
Labels map[string]string

string pairs for labels

Memory int
  • Set memory limit for build
MemorySwap int
  • Total memory (memory + swap), -1 to enable unlimited swap
NetworkMode string
  • Set the networking mode for the RUN instructions during build
NoCache bool
  • Do not use the cache when building the image
Platform string
  • Set platform if server is multi-platform capable
PullParent bool
  • Attempt to pull the image even if an older image exists locally
RemoteContext string
  • A Git repository URI or HTTP/HTTPS context URI
Remove bool
  • Remove intermediate containers after a successful build (default behavior)
SecurityOpts []string
  • Security options
SessionId string
ShmSize int
  • Size of /dev/shm in bytes. The size must be greater than 0
Squash bool
  • squash the new layers into a new image with a single new layer
SuppressOutput bool
  • Suppress the build output and print image ID on success
Target string
  • Set the target build stage to build
Ulimits []RegistryImageBuildUlimit
  • See Ulimit below for details
Version string
  • Version of the unerlying builder to use
context string
  • The path to the context folder
authConfigs RegistryImageBuildAuthConfig[]
  • See AuthConfig below for details
buildArgs {[key: string]: string}

string pairs for build-time variables

buildId string
  • BuildID is an optional identifier that can be passed together with the build request. The same identifier can be used to gracefully cancel the build with the cancel request
cacheFroms string[]
  • Images to consider as cache sources
cgroupParent string
  • Optional parent cgroup for the container
cpuPeriod number
  • The length of a CPU period in microseconds
cpuQuota number
  • Microseconds of CPU time that the container can get in a CPU period
cpuSetCpus string
  • CPUs in which to allow execution (e.g., 0-3, 0,1)
cpuSetMems string
  • MEMs in which to allow execution (0-3, 0,1)
cpuShares number
  • CPU shares (relative weight)
dockerfile string
  • Dockerfile file. Default is “Dockerfile”
extraHosts string[]
  • A list of hostnames/IP mappings to add to the container’s /etc/hosts file. Specified in the form [“hostname:IP”]
forceRemove boolean
  • Always remove intermediate containers
isolation string
  • Isolation represents the isolation technology of a container. The supported values are platform specific
labels {[key: string]: string}

string pairs for labels

memory number
  • Set memory limit for build
memorySwap number
  • Total memory (memory + swap), -1 to enable unlimited swap
networkMode string
  • Set the networking mode for the RUN instructions during build
noCache boolean
  • Do not use the cache when building the image
platform string
  • Set platform if server is multi-platform capable
pullParent boolean
  • Attempt to pull the image even if an older image exists locally
remoteContext string
  • A Git repository URI or HTTP/HTTPS context URI
remove boolean
  • Remove intermediate containers after a successful build (default behavior)
securityOpts string[]
  • Security options
sessionId string
shmSize number
  • Size of /dev/shm in bytes. The size must be greater than 0
squash boolean
  • squash the new layers into a new image with a single new layer
suppressOutput boolean
  • Suppress the build output and print image ID on success
target string
  • Set the target build stage to build
ulimits RegistryImageBuildUlimit[]
  • See Ulimit below for details
version string
  • Version of the unerlying builder to use
context str
  • The path to the context folder
auth_configs Sequence[RegistryImageBuildAuthConfigArgs]
  • See AuthConfig below for details
build_args Mapping[str, str]

string pairs for build-time variables

build_id str
  • BuildID is an optional identifier that can be passed together with the build request. The same identifier can be used to gracefully cancel the build with the cancel request
cache_froms Sequence[str]
  • Images to consider as cache sources
cgroup_parent str
  • Optional parent cgroup for the container
cpu_period int
  • The length of a CPU period in microseconds
cpu_quota int
  • Microseconds of CPU time that the container can get in a CPU period
cpu_set_cpus str
  • CPUs in which to allow execution (e.g., 0-3, 0,1)
cpu_set_mems str
  • MEMs in which to allow execution (0-3, 0,1)
cpu_shares int
  • CPU shares (relative weight)
dockerfile str
  • Dockerfile file. Default is “Dockerfile”
extra_hosts Sequence[str]
  • A list of hostnames/IP mappings to add to the container’s /etc/hosts file. Specified in the form [“hostname:IP”]
force_remove bool
  • Always remove intermediate containers
isolation str
  • Isolation represents the isolation technology of a container. The supported values are platform specific
labels Mapping[str, str]

string pairs for labels

memory int
  • Set memory limit for build
memory_swap int
  • Total memory (memory + swap), -1 to enable unlimited swap
network_mode str
  • Set the networking mode for the RUN instructions during build
no_cache bool
  • Do not use the cache when building the image
platform str
  • Set platform if server is multi-platform capable
pull_parent bool
  • Attempt to pull the image even if an older image exists locally
remote_context str
  • A Git repository URI or HTTP/HTTPS context URI
remove bool
  • Remove intermediate containers after a successful build (default behavior)
security_opts Sequence[str]
  • Security options
session_id str
shm_size int
  • Size of /dev/shm in bytes. The size must be greater than 0
squash bool
  • squash the new layers into a new image with a single new layer
suppress_output bool
  • Suppress the build output and print image ID on success
target str
  • Set the target build stage to build
ulimits Sequence[RegistryImageBuildUlimitArgs]
  • See Ulimit below for details
version str
  • Version of the unerlying builder to use

RegistryImageBuildAuthConfig

HostName string

hostname of the registry

Auth string

the auth token

Email string

the user emal

IdentityToken string

the identity token

Password string

the registry password

RegistryToken string

the registry token

ServerAddress string

the server address

UserName string

the registry user name

HostName string

hostname of the registry

Auth string

the auth token

Email string

the user emal

IdentityToken string

the identity token

Password string

the registry password

RegistryToken string

the registry token

ServerAddress string

the server address

UserName string

the registry user name

hostName string

hostname of the registry

auth string

the auth token

email string

the user emal

identityToken string

the identity token

password string

the registry password

registryToken string

the registry token

serverAddress string

the server address

userName string

the registry user name

host_name str

hostname of the registry

auth str

the auth token

email str

the user emal

identity_token str

the identity token

password str

the registry password

registry_token str

the registry token

server_address str

the server address

user_name str

the registry user name

RegistryImageBuildUlimit

Hard int
  • hard limit
Name string

type of ulimit, e.g. nofile

Soft int
  • soft limit
Hard int
  • hard limit
Name string

type of ulimit, e.g. nofile

Soft int
  • soft limit
hard number
  • hard limit
name string

type of ulimit, e.g. nofile

soft number
  • soft limit
hard int
  • hard limit
name str

type of ulimit, e.g. nofile

soft int
  • soft limit

Package Details

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