Rename to docker-build

This commit is contained in:
Bryce Lampe
2024-04-15 14:51:07 -07:00
parent 4cd6d49ba9
commit 12bf5dd689
139 changed files with 638 additions and 645 deletions

View File

@@ -0,0 +1 @@
A Pulumi provider for Docker buildx

View File

@@ -0,0 +1,46 @@
# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from . import _utilities
import typing
# Export this package's modules as members:
from ._enums import *
from .image import *
from .index import *
from .provider import *
from ._inputs import *
from . import outputs
# Make subpackages available:
if typing.TYPE_CHECKING:
import pulumi_docker_build.config as __config
config = __config
else:
config = _utilities.lazy_import('pulumi_docker_build.config')
_utilities.register(
resource_modules="""
[
{
"pkg": "docker-build",
"mod": "index",
"fqn": "pulumi_docker_build",
"classes": {
"docker-build:index:Image": "Image",
"docker-build:index:Index": "Index"
}
}
]
""",
resource_packages="""
[
{
"pkg": "docker-build",
"token": "pulumi:providers:docker-build",
"fqn": "pulumi_docker_build",
"class": "Provider"
}
]
"""
)

84
sdk/python/pulumi_docker_build/_enums.py generated Normal file
View File

@@ -0,0 +1,84 @@
# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'CacheMode',
'CompressionType',
'NetworkMode',
'Platform',
]
class CacheMode(str, Enum):
MIN = "min"
"""
Only layers that are exported into the resulting image are cached.
"""
MAX = "max"
"""
All layers are cached, even those of intermediate steps.
"""
class CompressionType(str, Enum):
GZIP = "gzip"
"""
Use `gzip` for compression.
"""
ESTARGZ = "estargz"
"""
Use `estargz` for compression.
"""
ZSTD = "zstd"
"""
Use `zstd` for compression.
"""
class NetworkMode(str, Enum):
DEFAULT = "default"
"""
The default sandbox network mode.
"""
HOST = "host"
"""
Host network mode.
"""
NONE = "none"
"""
Disable network access.
"""
class Platform(str, Enum):
DARWIN_386 = "darwin/386"
DARWIN_AMD64 = "darwin/amd64"
DARWIN_ARM = "darwin/arm"
DARWIN_ARM64 = "darwin/arm64"
DRAGONFLY_AMD64 = "dragonfly/amd64"
FREEBSD_386 = "freebsd/386"
FREEBSD_AMD64 = "freebsd/amd64"
FREEBSD_ARM = "freebsd/arm"
LINUX_386 = "linux/386"
LINUX_AMD64 = "linux/amd64"
LINUX_ARM = "linux/arm"
LINUX_ARM64 = "linux/arm64"
LINUX_MIPS64 = "linux/mips64"
LINUX_MIPS64LE = "linux/mips64le"
LINUX_PPC64LE = "linux/ppc64le"
LINUX_RISCV64 = "linux/riscv64"
LINUX_S390X = "linux/s390x"
NETBSD_386 = "netbsd/386"
NETBSD_AMD64 = "netbsd/amd64"
NETBSD_ARM = "netbsd/arm"
OPENBSD_386 = "openbsd/386"
OPENBSD_AMD64 = "openbsd/amd64"
OPENBSD_ARM = "openbsd/arm"
PLAN9_386 = "plan9/386"
PLAN9_AMD64 = "plan9/amd64"
SOLARIS_AMD64 = "solaris/amd64"
WINDOWS_386 = "windows/386"
WINDOWS_AMD64 = "windows/amd64"

2672
sdk/python/pulumi_docker_build/_inputs.py generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,291 @@
# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import asyncio
import importlib.metadata
import importlib.util
import inspect
import json
import os
import sys
import typing
import pulumi
import pulumi.runtime
from pulumi.runtime.sync_await import _sync_await
from semver import VersionInfo as SemverVersion
from parver import Version as PEP440Version
def get_env(*args):
for v in args:
value = os.getenv(v)
if value is not None:
return value
return None
def get_env_bool(*args):
str = get_env(*args)
if str is not None:
# NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
# Terraform uses internally when parsing boolean values.
if str in ["1", "t", "T", "true", "TRUE", "True"]:
return True
if str in ["0", "f", "F", "false", "FALSE", "False"]:
return False
return None
def get_env_int(*args):
str = get_env(*args)
if str is not None:
try:
return int(str)
except:
return None
return None
def get_env_float(*args):
str = get_env(*args)
if str is not None:
try:
return float(str)
except:
return None
return None
def _get_semver_version():
# __name__ is set to the fully-qualified name of the current module, In our case, it will be
# <some module>._utilities. <some module> is the module we want to query the version for.
root_package, *rest = __name__.split('.')
# pkg_resources uses setuptools to inspect the set of installed packages. We use it here to ask
# for the currently installed version of the root package (i.e. us) and get its version.
# Unfortunately, PEP440 and semver differ slightly in incompatible ways. The Pulumi engine expects
# to receive a valid semver string when receiving requests from the language host, so it's our
# responsibility as the library to convert our own PEP440 version into a valid semver string.
pep440_version_string = importlib.metadata.version(root_package)
pep440_version = PEP440Version.parse(pep440_version_string)
(major, minor, patch) = pep440_version.release
prerelease = None
if pep440_version.pre_tag == 'a':
prerelease = f"alpha.{pep440_version.pre}"
elif pep440_version.pre_tag == 'b':
prerelease = f"beta.{pep440_version.pre}"
elif pep440_version.pre_tag == 'rc':
prerelease = f"rc.{pep440_version.pre}"
elif pep440_version.dev is not None:
prerelease = f"dev.{pep440_version.dev}"
# The only significant difference between PEP440 and semver as it pertains to us is that PEP440 has explicit support
# for dev builds, while semver encodes them as "prerelease" versions. In order to bridge between the two, we convert
# our dev build version into a prerelease tag. This matches what all of our other packages do when constructing
# their own semver string.
return SemverVersion(major=major, minor=minor, patch=patch, prerelease=prerelease)
# Determine the version once and cache the value, which measurably improves program performance.
_version = _get_semver_version()
_version_str = str(_version)
def get_version():
return _version_str
def get_resource_opts_defaults() -> pulumi.ResourceOptions:
return pulumi.ResourceOptions(
version=get_version(),
plugin_download_url=get_plugin_download_url(),
)
def get_invoke_opts_defaults() -> pulumi.InvokeOptions:
return pulumi.InvokeOptions(
version=get_version(),
plugin_download_url=get_plugin_download_url(),
)
def get_resource_args_opts(resource_args_type, resource_options_type, *args, **kwargs):
"""
Return the resource args and options given the *args and **kwargs of a resource's
__init__ method.
"""
resource_args, opts = None, None
# If the first item is the resource args type, save it and remove it from the args list.
if args and isinstance(args[0], resource_args_type):
resource_args, args = args[0], args[1:]
# Now look at the first item in the args list again.
# If the first item is the resource options class, save it.
if args and isinstance(args[0], resource_options_type):
opts = args[0]
# If resource_args is None, see if "args" is in kwargs, and, if so, if it's typed as the
# the resource args type.
if resource_args is None:
a = kwargs.get("args")
if isinstance(a, resource_args_type):
resource_args = a
# If opts is None, look it up in kwargs.
if opts is None:
opts = kwargs.get("opts")
return resource_args, opts
# Temporary: just use pulumi._utils.lazy_import once everyone upgrades.
def lazy_import(fullname):
import pulumi._utils as u
f = getattr(u, 'lazy_import', None)
if f is None:
f = _lazy_import_temp
return f(fullname)
# Copied from pulumi._utils.lazy_import, see comments there.
def _lazy_import_temp(fullname):
m = sys.modules.get(fullname, None)
if m is not None:
return m
spec = importlib.util.find_spec(fullname)
m = sys.modules.get(fullname, None)
if m is not None:
return m
loader = importlib.util.LazyLoader(spec.loader)
spec.loader = loader
module = importlib.util.module_from_spec(spec)
m = sys.modules.get(fullname, None)
if m is not None:
return m
sys.modules[fullname] = module
loader.exec_module(module)
return module
class Package(pulumi.runtime.ResourcePackage):
def __init__(self, pkg_info):
super().__init__()
self.pkg_info = pkg_info
def version(self):
return _version
def construct_provider(self, name: str, typ: str, urn: str) -> pulumi.ProviderResource:
if typ != self.pkg_info['token']:
raise Exception(f"unknown provider type {typ}")
Provider = getattr(lazy_import(self.pkg_info['fqn']), self.pkg_info['class'])
return Provider(name, pulumi.ResourceOptions(urn=urn))
class Module(pulumi.runtime.ResourceModule):
def __init__(self, mod_info):
super().__init__()
self.mod_info = mod_info
def version(self):
return _version
def construct(self, name: str, typ: str, urn: str) -> pulumi.Resource:
class_name = self.mod_info['classes'].get(typ, None)
if class_name is None:
raise Exception(f"unknown resource type {typ}")
TheClass = getattr(lazy_import(self.mod_info['fqn']), class_name)
return TheClass(name, pulumi.ResourceOptions(urn=urn))
def register(resource_modules, resource_packages):
resource_modules = json.loads(resource_modules)
resource_packages = json.loads(resource_packages)
for pkg_info in resource_packages:
pulumi.runtime.register_resource_package(pkg_info['pkg'], Package(pkg_info))
for mod_info in resource_modules:
pulumi.runtime.register_resource_module(
mod_info['pkg'],
mod_info['mod'],
Module(mod_info))
_F = typing.TypeVar('_F', bound=typing.Callable[..., typing.Any])
def lift_output_func(func: typing.Any) -> typing.Callable[[_F], _F]:
"""Decorator internally used on {fn}_output lifted function versions
to implement them automatically from the un-lifted function."""
func_sig = inspect.signature(func)
def lifted_func(*args, opts=None, **kwargs):
bound_args = func_sig.bind(*args, **kwargs)
# Convert tuple to list, see pulumi/pulumi#8172
args_list = list(bound_args.args)
return pulumi.Output.from_input({
'args': args_list,
'kwargs': bound_args.kwargs
}).apply(lambda resolved_args: func(*resolved_args['args'],
opts=opts,
**resolved_args['kwargs']))
return (lambda _: lifted_func)
def call_plain(
tok: str,
props: pulumi.Inputs,
res: typing.Optional[pulumi.Resource] = None,
typ: typing.Optional[type] = None,
) -> typing.Any:
"""
Wraps pulumi.runtime.plain to force the output and return it plainly.
"""
output = pulumi.runtime.call(tok, props, res, typ)
# Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency.
result, known, secret, _ = _sync_await(asyncio.ensure_future(_await_output(output)))
problem = None
if not known:
problem = ' an unknown value'
elif secret:
problem = ' a secret value'
if problem:
raise AssertionError(
f"Plain resource method '{tok}' incorrectly returned {problem}. "
+ "This is an error in the provider, please report this to the provider developer."
)
return result
async def _await_output(o: pulumi.Output[typing.Any]) -> typing.Tuple[object, bool, bool, set]:
return (
await o._future,
await o._is_known,
await o._is_secret,
await o._resources,
)
def get_plugin_download_url():
return "github.com/pulumi/pulumi-docker-build"

View File

@@ -0,0 +1,8 @@
# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import sys
from .vars import _ExportableConfig
sys.modules[__name__].__class__ = _ExportableConfig

View File

@@ -0,0 +1,19 @@
# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from .. import outputs as _root_outputs
host: str
"""
The build daemon's address.
"""
registries: Optional[str]

View File

@@ -0,0 +1,29 @@
# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from .. import outputs as _root_outputs
import types
__config__ = pulumi.Config('docker-build')
class _ExportableConfig(types.ModuleType):
@property
def host(self) -> str:
"""
The build daemon's address.
"""
return __config__.get('host') or (_utilities.get_env('DOCKER_HOST') or '')
@property
def registries(self) -> Optional[str]:
return __config__.get('registries')

1798
sdk/python/pulumi_docker_build/image.py generated Normal file

File diff suppressed because it is too large Load Diff

352
sdk/python/pulumi_docker_build/index.py generated Normal file
View File

@@ -0,0 +1,352 @@
# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *
__all__ = ['IndexArgs', 'Index']
@pulumi.input_type
class IndexArgs:
def __init__(__self__, *,
sources: pulumi.Input[Sequence[pulumi.Input[str]]],
tag: pulumi.Input[str],
push: Optional[pulumi.Input[bool]] = None,
registry: Optional[pulumi.Input['RegistryArgs']] = None):
"""
The set of arguments for constructing a Index resource.
:param pulumi.Input[Sequence[pulumi.Input[str]]] sources: Existing images to include in the index.
:param pulumi.Input[str] tag: The tag to apply to the index.
:param pulumi.Input[bool] push: If true, push the index to the target registry.
Defaults to `true`.
:param pulumi.Input['RegistryArgs'] registry: Authentication for the registry where the tagged index will be pushed.
Credentials can also be included with the provider's configuration.
"""
pulumi.set(__self__, "sources", sources)
pulumi.set(__self__, "tag", tag)
if push is None:
push = True
if push is not None:
pulumi.set(__self__, "push", push)
if registry is not None:
pulumi.set(__self__, "registry", registry)
@property
@pulumi.getter
def sources(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
"""
Existing images to include in the index.
"""
return pulumi.get(self, "sources")
@sources.setter
def sources(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
pulumi.set(self, "sources", value)
@property
@pulumi.getter
def tag(self) -> pulumi.Input[str]:
"""
The tag to apply to the index.
"""
return pulumi.get(self, "tag")
@tag.setter
def tag(self, value: pulumi.Input[str]):
pulumi.set(self, "tag", value)
@property
@pulumi.getter
def push(self) -> Optional[pulumi.Input[bool]]:
"""
If true, push the index to the target registry.
Defaults to `true`.
"""
return pulumi.get(self, "push")
@push.setter
def push(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "push", value)
@property
@pulumi.getter
def registry(self) -> Optional[pulumi.Input['RegistryArgs']]:
"""
Authentication for the registry where the tagged index will be pushed.
Credentials can also be included with the provider's configuration.
"""
return pulumi.get(self, "registry")
@registry.setter
def registry(self, value: Optional[pulumi.Input['RegistryArgs']]):
pulumi.set(self, "registry", value)
class Index(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
push: Optional[pulumi.Input[bool]] = None,
registry: Optional[pulumi.Input[pulumi.InputType['RegistryArgs']]] = None,
sources: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
tag: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
An index (or manifest list) referencing one or more existing images.
Useful for crafting a multi-platform image from several
platform-specific images.
This creates an OCI image index or a Docker manifest list depending on
the media types of the source images.
## Example Usage
### Multi-platform registry caching
```python
import pulumi
import pulumi_docker_build as docker_build
amd64 = docker_build.Image("amd64",
cache_from=[docker_build.CacheFromArgs(
registry=docker_build.CacheFromRegistryArgs(
ref="docker.io/pulumi/pulumi:cache-amd64",
),
)],
cache_to=[docker_build.CacheToArgs(
registry=docker_build.CacheToRegistryArgs(
mode=docker_build.CacheMode.MAX,
ref="docker.io/pulumi/pulumi:cache-amd64",
),
)],
context=docker_build.BuildContextArgs(
location="app",
),
platforms=[docker_build.Platform.LINUX_AMD64],
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
arm64 = docker_build.Image("arm64",
cache_from=[docker_build.CacheFromArgs(
registry=docker_build.CacheFromRegistryArgs(
ref="docker.io/pulumi/pulumi:cache-arm64",
),
)],
cache_to=[docker_build.CacheToArgs(
registry=docker_build.CacheToRegistryArgs(
mode=docker_build.CacheMode.MAX,
ref="docker.io/pulumi/pulumi:cache-arm64",
),
)],
context=docker_build.BuildContextArgs(
location="app",
),
platforms=[docker_build.Platform.LINUX_ARM64],
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
index = docker_build.Index("index",
sources=[
amd64.ref,
arm64.ref,
],
tag="docker.io/pulumi/pulumi:3.107.0")
pulumi.export("ref", index.ref)
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[bool] push: If true, push the index to the target registry.
Defaults to `true`.
:param pulumi.Input[pulumi.InputType['RegistryArgs']] registry: Authentication for the registry where the tagged index will be pushed.
Credentials can also be included with the provider's configuration.
:param pulumi.Input[Sequence[pulumi.Input[str]]] sources: Existing images to include in the index.
:param pulumi.Input[str] tag: The tag to apply to the index.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: IndexArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
An index (or manifest list) referencing one or more existing images.
Useful for crafting a multi-platform image from several
platform-specific images.
This creates an OCI image index or a Docker manifest list depending on
the media types of the source images.
## Example Usage
### Multi-platform registry caching
```python
import pulumi
import pulumi_docker_build as docker_build
amd64 = docker_build.Image("amd64",
cache_from=[docker_build.CacheFromArgs(
registry=docker_build.CacheFromRegistryArgs(
ref="docker.io/pulumi/pulumi:cache-amd64",
),
)],
cache_to=[docker_build.CacheToArgs(
registry=docker_build.CacheToRegistryArgs(
mode=docker_build.CacheMode.MAX,
ref="docker.io/pulumi/pulumi:cache-amd64",
),
)],
context=docker_build.BuildContextArgs(
location="app",
),
platforms=[docker_build.Platform.LINUX_AMD64],
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
arm64 = docker_build.Image("arm64",
cache_from=[docker_build.CacheFromArgs(
registry=docker_build.CacheFromRegistryArgs(
ref="docker.io/pulumi/pulumi:cache-arm64",
),
)],
cache_to=[docker_build.CacheToArgs(
registry=docker_build.CacheToRegistryArgs(
mode=docker_build.CacheMode.MAX,
ref="docker.io/pulumi/pulumi:cache-arm64",
),
)],
context=docker_build.BuildContextArgs(
location="app",
),
platforms=[docker_build.Platform.LINUX_ARM64],
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
index = docker_build.Index("index",
sources=[
amd64.ref,
arm64.ref,
],
tag="docker.io/pulumi/pulumi:3.107.0")
pulumi.export("ref", index.ref)
```
:param str resource_name: The name of the resource.
:param IndexArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(IndexArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
push: Optional[pulumi.Input[bool]] = None,
registry: Optional[pulumi.Input[pulumi.InputType['RegistryArgs']]] = None,
sources: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
tag: Optional[pulumi.Input[str]] = None,
__props__=None):
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = IndexArgs.__new__(IndexArgs)
if push is None:
push = True
__props__.__dict__["push"] = push
__props__.__dict__["registry"] = registry
if sources is None and not opts.urn:
raise TypeError("Missing required property 'sources'")
__props__.__dict__["sources"] = sources
if tag is None and not opts.urn:
raise TypeError("Missing required property 'tag'")
__props__.__dict__["tag"] = tag
__props__.__dict__["ref"] = None
super(Index, __self__).__init__(
'docker-build:index:Index',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'Index':
"""
Get an existing Index resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = IndexArgs.__new__(IndexArgs)
__props__.__dict__["push"] = None
__props__.__dict__["ref"] = None
__props__.__dict__["registry"] = None
__props__.__dict__["sources"] = None
__props__.__dict__["tag"] = None
return Index(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def push(self) -> pulumi.Output[Optional[bool]]:
"""
If true, push the index to the target registry.
Defaults to `true`.
"""
return pulumi.get(self, "push")
@property
@pulumi.getter
def ref(self) -> pulumi.Output[str]:
"""
The pushed tag with digest.
Identical to the tag if the index was not pushed.
"""
return pulumi.get(self, "ref")
@property
@pulumi.getter
def registry(self) -> pulumi.Output[Optional['outputs.Registry']]:
"""
Authentication for the registry where the tagged index will be pushed.
Credentials can also be included with the provider's configuration.
"""
return pulumi.get(self, "registry")
@property
@pulumi.getter
def sources(self) -> pulumi.Output[Sequence[str]]:
"""
Existing images to include in the index.
"""
return pulumi.get(self, "sources")
@property
@pulumi.getter
def tag(self) -> pulumi.Output[str]:
"""
The tag to apply to the index.
"""
return pulumi.get(self, "tag")

2399
sdk/python/pulumi_docker_build/outputs.py generated Normal file

File diff suppressed because it is too large Load Diff

118
sdk/python/pulumi_docker_build/provider.py generated Normal file
View File

@@ -0,0 +1,118 @@
# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from ._inputs import *
__all__ = ['ProviderArgs', 'Provider']
@pulumi.input_type
class ProviderArgs:
def __init__(__self__, *,
host: Optional[pulumi.Input[str]] = None,
registries: Optional[pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]]] = None):
"""
The set of arguments for constructing a Provider resource.
:param pulumi.Input[str] host: The build daemon's address.
"""
if host is None:
host = (_utilities.get_env('DOCKER_HOST') or '')
if host is not None:
pulumi.set(__self__, "host", host)
if registries is not None:
pulumi.set(__self__, "registries", registries)
@property
@pulumi.getter
def host(self) -> Optional[pulumi.Input[str]]:
"""
The build daemon's address.
"""
return pulumi.get(self, "host")
@host.setter
def host(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "host", value)
@property
@pulumi.getter
def registries(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]]]:
return pulumi.get(self, "registries")
@registries.setter
def registries(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]]]):
pulumi.set(self, "registries", value)
class Provider(pulumi.ProviderResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
host: Optional[pulumi.Input[str]] = None,
registries: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RegistryArgs']]]]] = None,
__props__=None):
"""
Create a Docker-build resource with the given unique name, props, and options.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] host: The build daemon's address.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: Optional[ProviderArgs] = None,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Create a Docker-build resource with the given unique name, props, and options.
:param str resource_name: The name of the resource.
:param ProviderArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(ProviderArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
host: Optional[pulumi.Input[str]] = None,
registries: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['RegistryArgs']]]]] = None,
__props__=None):
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = ProviderArgs.__new__(ProviderArgs)
if host is None:
host = (_utilities.get_env('DOCKER_HOST') or '')
__props__.__dict__["host"] = host
__props__.__dict__["registries"] = pulumi.Output.from_input(registries).apply(pulumi.runtime.to_json) if registries is not None else None
super(Provider, __self__).__init__(
'docker-build',
resource_name,
__props__,
opts)
@property
@pulumi.getter
def host(self) -> pulumi.Output[Optional[str]]:
"""
The build daemon's address.
"""
return pulumi.get(self, "host")

View File

@@ -0,0 +1,5 @@
{
"resource": true,
"name": "docker-build",
"server": "github.com/pulumi/pulumi-docker-build"
}

0
sdk/python/pulumi_docker_build/py.typed generated Normal file
View File