pulumi-docker 4.7.0a1705607229__py3-none-any.whl → 4.7.0a1736833147__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pulumi-docker might be problematic. Click here for more details.
- pulumi_docker/_inputs.py +1583 -34
- pulumi_docker/_utilities.py +43 -7
- pulumi_docker/config/__init__.pyi +5 -0
- pulumi_docker/config/outputs.py +27 -0
- pulumi_docker/config/vars.py +5 -0
- pulumi_docker/container.py +202 -181
- pulumi_docker/get_logs.py +34 -5
- pulumi_docker/get_network.py +19 -6
- pulumi_docker/get_plugin.py +35 -11
- pulumi_docker/get_registry_image.py +24 -13
- pulumi_docker/get_remote_image.py +22 -5
- pulumi_docker/image.py +73 -52
- pulumi_docker/network.py +95 -46
- pulumi_docker/outputs.py +95 -34
- pulumi_docker/plugin.py +19 -46
- pulumi_docker/provider.py +7 -2
- pulumi_docker/pulumi-plugin.json +2 -1
- pulumi_docker/registry_image.py +19 -46
- pulumi_docker/remote_image.py +107 -48
- pulumi_docker/secret.py +16 -7
- pulumi_docker/service.py +127 -82
- pulumi_docker/service_config.py +55 -10
- pulumi_docker/tag.py +5 -0
- pulumi_docker/volume.py +76 -27
- {pulumi_docker-4.7.0a1705607229.dist-info → pulumi_docker-4.7.0a1736833147.dist-info}/METADATA +7 -6
- pulumi_docker-4.7.0a1736833147.dist-info/RECORD +32 -0
- {pulumi_docker-4.7.0a1705607229.dist-info → pulumi_docker-4.7.0a1736833147.dist-info}/WHEEL +1 -1
- pulumi_docker-4.7.0a1705607229.dist-info/RECORD +0 -32
- {pulumi_docker-4.7.0a1705607229.dist-info → pulumi_docker-4.7.0a1736833147.dist-info}/top_level.txt +0 -0
pulumi_docker/get_logs.py
CHANGED
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
|
|
12
17
|
__all__ = [
|
|
@@ -213,9 +218,6 @@ def get_logs(details: Optional[bool] = None,
|
|
|
213
218
|
tail=pulumi.get(__ret__, 'tail'),
|
|
214
219
|
timestamps=pulumi.get(__ret__, 'timestamps'),
|
|
215
220
|
until=pulumi.get(__ret__, 'until'))
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
@_utilities.lift_output_func(get_logs)
|
|
219
221
|
def get_logs_output(details: Optional[pulumi.Input[Optional[bool]]] = None,
|
|
220
222
|
discard_headers: Optional[pulumi.Input[Optional[bool]]] = None,
|
|
221
223
|
follow: Optional[pulumi.Input[Optional[bool]]] = None,
|
|
@@ -227,7 +229,7 @@ def get_logs_output(details: Optional[pulumi.Input[Optional[bool]]] = None,
|
|
|
227
229
|
tail: Optional[pulumi.Input[Optional[str]]] = None,
|
|
228
230
|
timestamps: Optional[pulumi.Input[Optional[bool]]] = None,
|
|
229
231
|
until: Optional[pulumi.Input[Optional[str]]] = None,
|
|
230
|
-
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetLogsResult]:
|
|
232
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetLogsResult]:
|
|
231
233
|
"""
|
|
232
234
|
`get_logs` provides logs from specific container
|
|
233
235
|
|
|
@@ -236,4 +238,31 @@ def get_logs_output(details: Optional[pulumi.Input[Optional[bool]]] = None,
|
|
|
236
238
|
:param bool logs_list_string_enabled: If true populate computed value `logs_list_string`
|
|
237
239
|
:param str name: The name of the Docker Container
|
|
238
240
|
"""
|
|
239
|
-
|
|
241
|
+
__args__ = dict()
|
|
242
|
+
__args__['details'] = details
|
|
243
|
+
__args__['discardHeaders'] = discard_headers
|
|
244
|
+
__args__['follow'] = follow
|
|
245
|
+
__args__['logsListStringEnabled'] = logs_list_string_enabled
|
|
246
|
+
__args__['name'] = name
|
|
247
|
+
__args__['showStderr'] = show_stderr
|
|
248
|
+
__args__['showStdout'] = show_stdout
|
|
249
|
+
__args__['since'] = since
|
|
250
|
+
__args__['tail'] = tail
|
|
251
|
+
__args__['timestamps'] = timestamps
|
|
252
|
+
__args__['until'] = until
|
|
253
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
254
|
+
__ret__ = pulumi.runtime.invoke_output('docker:index/getLogs:getLogs', __args__, opts=opts, typ=GetLogsResult)
|
|
255
|
+
return __ret__.apply(lambda __response__: GetLogsResult(
|
|
256
|
+
details=pulumi.get(__response__, 'details'),
|
|
257
|
+
discard_headers=pulumi.get(__response__, 'discard_headers'),
|
|
258
|
+
follow=pulumi.get(__response__, 'follow'),
|
|
259
|
+
id=pulumi.get(__response__, 'id'),
|
|
260
|
+
logs_list_string_enabled=pulumi.get(__response__, 'logs_list_string_enabled'),
|
|
261
|
+
logs_list_strings=pulumi.get(__response__, 'logs_list_strings'),
|
|
262
|
+
name=pulumi.get(__response__, 'name'),
|
|
263
|
+
show_stderr=pulumi.get(__response__, 'show_stderr'),
|
|
264
|
+
show_stdout=pulumi.get(__response__, 'show_stdout'),
|
|
265
|
+
since=pulumi.get(__response__, 'since'),
|
|
266
|
+
tail=pulumi.get(__response__, 'tail'),
|
|
267
|
+
timestamps=pulumi.get(__response__, 'timestamps'),
|
|
268
|
+
until=pulumi.get(__response__, 'until')))
|
pulumi_docker/get_network.py
CHANGED
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
from . import outputs
|
|
12
17
|
|
|
@@ -87,7 +92,7 @@ class GetNetworkResult:
|
|
|
87
92
|
|
|
88
93
|
@property
|
|
89
94
|
@pulumi.getter
|
|
90
|
-
def options(self) -> Mapping[str,
|
|
95
|
+
def options(self) -> Mapping[str, str]:
|
|
91
96
|
"""
|
|
92
97
|
Only available with bridge networks. See [bridge options docs](https://docs.docker.com/engine/reference/commandline/network_create/#bridge-driver-options) for more details.
|
|
93
98
|
"""
|
|
@@ -147,11 +152,8 @@ def get_network(name: Optional[str] = None,
|
|
|
147
152
|
name=pulumi.get(__ret__, 'name'),
|
|
148
153
|
options=pulumi.get(__ret__, 'options'),
|
|
149
154
|
scope=pulumi.get(__ret__, 'scope'))
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
@_utilities.lift_output_func(get_network)
|
|
153
155
|
def get_network_output(name: Optional[pulumi.Input[str]] = None,
|
|
154
|
-
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetNetworkResult]:
|
|
156
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetNetworkResult]:
|
|
155
157
|
"""
|
|
156
158
|
`Network` provides details about a specific Docker Network.
|
|
157
159
|
|
|
@@ -167,4 +169,15 @@ def get_network_output(name: Optional[pulumi.Input[str]] = None,
|
|
|
167
169
|
|
|
168
170
|
:param str name: The name of the Docker network.
|
|
169
171
|
"""
|
|
170
|
-
|
|
172
|
+
__args__ = dict()
|
|
173
|
+
__args__['name'] = name
|
|
174
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
175
|
+
__ret__ = pulumi.runtime.invoke_output('docker:index/getNetwork:getNetwork', __args__, opts=opts, typ=GetNetworkResult)
|
|
176
|
+
return __ret__.apply(lambda __response__: GetNetworkResult(
|
|
177
|
+
driver=pulumi.get(__response__, 'driver'),
|
|
178
|
+
id=pulumi.get(__response__, 'id'),
|
|
179
|
+
internal=pulumi.get(__response__, 'internal'),
|
|
180
|
+
ipam_configs=pulumi.get(__response__, 'ipam_configs'),
|
|
181
|
+
name=pulumi.get(__response__, 'name'),
|
|
182
|
+
options=pulumi.get(__response__, 'options'),
|
|
183
|
+
scope=pulumi.get(__response__, 'scope')))
|
pulumi_docker/get_plugin.py
CHANGED
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
|
|
12
17
|
__all__ = [
|
|
@@ -124,10 +129,15 @@ def get_plugin(alias: Optional[str] = None,
|
|
|
124
129
|
|
|
125
130
|
## Example Usage
|
|
126
131
|
|
|
132
|
+
```python
|
|
133
|
+
import pulumi
|
|
134
|
+
import pulumi_docker as docker
|
|
135
|
+
|
|
127
136
|
### With alias
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
by_alias = docker.get_plugin(alias="sample-volume-plugin:latest")
|
|
138
|
+
### With ID
|
|
139
|
+
by_id = docker.get_plugin(id="e9a9db917b3bfd6706b5d3a66d4bceb9f")
|
|
140
|
+
```
|
|
131
141
|
|
|
132
142
|
|
|
133
143
|
:param str alias: The alias of the Docker plugin. If the tag is omitted, `:latest` is complemented to the attribute value.
|
|
@@ -147,24 +157,38 @@ def get_plugin(alias: Optional[str] = None,
|
|
|
147
157
|
id=pulumi.get(__ret__, 'id'),
|
|
148
158
|
name=pulumi.get(__ret__, 'name'),
|
|
149
159
|
plugin_reference=pulumi.get(__ret__, 'plugin_reference'))
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
@_utilities.lift_output_func(get_plugin)
|
|
153
160
|
def get_plugin_output(alias: Optional[pulumi.Input[Optional[str]]] = None,
|
|
154
161
|
id: Optional[pulumi.Input[Optional[str]]] = None,
|
|
155
|
-
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetPluginResult]:
|
|
162
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetPluginResult]:
|
|
156
163
|
"""
|
|
157
164
|
Reads the local Docker plugin. The plugin must be installed locally.
|
|
158
165
|
|
|
159
166
|
## Example Usage
|
|
160
167
|
|
|
168
|
+
```python
|
|
169
|
+
import pulumi
|
|
170
|
+
import pulumi_docker as docker
|
|
171
|
+
|
|
161
172
|
### With alias
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
173
|
+
by_alias = docker.get_plugin(alias="sample-volume-plugin:latest")
|
|
174
|
+
### With ID
|
|
175
|
+
by_id = docker.get_plugin(id="e9a9db917b3bfd6706b5d3a66d4bceb9f")
|
|
176
|
+
```
|
|
165
177
|
|
|
166
178
|
|
|
167
179
|
:param str alias: The alias of the Docker plugin. If the tag is omitted, `:latest` is complemented to the attribute value.
|
|
168
180
|
:param str id: The ID of the plugin, which has precedence over the `alias` of both are given
|
|
169
181
|
"""
|
|
170
|
-
|
|
182
|
+
__args__ = dict()
|
|
183
|
+
__args__['alias'] = alias
|
|
184
|
+
__args__['id'] = id
|
|
185
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
186
|
+
__ret__ = pulumi.runtime.invoke_output('docker:index/getPlugin:getPlugin', __args__, opts=opts, typ=GetPluginResult)
|
|
187
|
+
return __ret__.apply(lambda __response__: GetPluginResult(
|
|
188
|
+
alias=pulumi.get(__response__, 'alias'),
|
|
189
|
+
enabled=pulumi.get(__response__, 'enabled'),
|
|
190
|
+
envs=pulumi.get(__response__, 'envs'),
|
|
191
|
+
grant_all_permissions=pulumi.get(__response__, 'grant_all_permissions'),
|
|
192
|
+
id=pulumi.get(__response__, 'id'),
|
|
193
|
+
name=pulumi.get(__response__, 'name'),
|
|
194
|
+
plugin_reference=pulumi.get(__response__, 'plugin_reference')))
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
|
|
12
17
|
__all__ = [
|
|
@@ -92,10 +97,10 @@ def get_registry_image(insecure_skip_verify: Optional[bool] = None,
|
|
|
92
97
|
import pulumi
|
|
93
98
|
import pulumi_docker as docker
|
|
94
99
|
|
|
95
|
-
|
|
96
|
-
ubuntu_remote_image = docker.RemoteImage("
|
|
97
|
-
name=
|
|
98
|
-
pull_triggers=[
|
|
100
|
+
ubuntu = docker.get_registry_image(name="ubuntu:precise")
|
|
101
|
+
ubuntu_remote_image = docker.RemoteImage("ubuntu",
|
|
102
|
+
name=ubuntu.name,
|
|
103
|
+
pull_triggers=[ubuntu.sha256_digest])
|
|
99
104
|
```
|
|
100
105
|
|
|
101
106
|
|
|
@@ -113,12 +118,9 @@ def get_registry_image(insecure_skip_verify: Optional[bool] = None,
|
|
|
113
118
|
insecure_skip_verify=pulumi.get(__ret__, 'insecure_skip_verify'),
|
|
114
119
|
name=pulumi.get(__ret__, 'name'),
|
|
115
120
|
sha256_digest=pulumi.get(__ret__, 'sha256_digest'))
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
@_utilities.lift_output_func(get_registry_image)
|
|
119
121
|
def get_registry_image_output(insecure_skip_verify: Optional[pulumi.Input[Optional[bool]]] = None,
|
|
120
122
|
name: Optional[pulumi.Input[str]] = None,
|
|
121
|
-
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetRegistryImageResult]:
|
|
123
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetRegistryImageResult]:
|
|
122
124
|
"""
|
|
123
125
|
Reads the image metadata from a Docker Registry. Used in conjunction with the RemoteImage resource to keep an image up to date on the latest available version of the tag.
|
|
124
126
|
|
|
@@ -128,14 +130,23 @@ def get_registry_image_output(insecure_skip_verify: Optional[pulumi.Input[Option
|
|
|
128
130
|
import pulumi
|
|
129
131
|
import pulumi_docker as docker
|
|
130
132
|
|
|
131
|
-
|
|
132
|
-
ubuntu_remote_image = docker.RemoteImage("
|
|
133
|
-
name=
|
|
134
|
-
pull_triggers=[
|
|
133
|
+
ubuntu = docker.get_registry_image(name="ubuntu:precise")
|
|
134
|
+
ubuntu_remote_image = docker.RemoteImage("ubuntu",
|
|
135
|
+
name=ubuntu.name,
|
|
136
|
+
pull_triggers=[ubuntu.sha256_digest])
|
|
135
137
|
```
|
|
136
138
|
|
|
137
139
|
|
|
138
140
|
:param bool insecure_skip_verify: If `true`, the verification of TLS certificates of the server/registry is disabled. Defaults to `false`
|
|
139
141
|
:param str name: The name of the Docker image, including any tags. e.g. `alpine:latest`
|
|
140
142
|
"""
|
|
141
|
-
|
|
143
|
+
__args__ = dict()
|
|
144
|
+
__args__['insecureSkipVerify'] = insecure_skip_verify
|
|
145
|
+
__args__['name'] = name
|
|
146
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
147
|
+
__ret__ = pulumi.runtime.invoke_output('docker:index/getRegistryImage:getRegistryImage', __args__, opts=opts, typ=GetRegistryImageResult)
|
|
148
|
+
return __ret__.apply(lambda __response__: GetRegistryImageResult(
|
|
149
|
+
id=pulumi.get(__response__, 'id'),
|
|
150
|
+
insecure_skip_verify=pulumi.get(__response__, 'insecure_skip_verify'),
|
|
151
|
+
name=pulumi.get(__response__, 'name'),
|
|
152
|
+
sha256_digest=pulumi.get(__response__, 'sha256_digest')))
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
|
|
12
17
|
__all__ = [
|
|
@@ -79,9 +84,13 @@ def get_remote_image(name: Optional[str] = None,
|
|
|
79
84
|
import pulumi
|
|
80
85
|
import pulumi_docker as docker
|
|
81
86
|
|
|
87
|
+
# uses the 'latest' tag
|
|
82
88
|
latest = docker.get_remote_image(name="nginx")
|
|
89
|
+
# uses a specific tag
|
|
83
90
|
specific = docker.get_remote_image(name="nginx:1.17.6")
|
|
91
|
+
# use the image digest
|
|
84
92
|
digest = docker.get_remote_image(name="nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
|
|
93
|
+
# uses the tag and the image digest
|
|
85
94
|
tag_and_digest = docker.get_remote_image(name="nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
|
|
86
95
|
```
|
|
87
96
|
|
|
@@ -97,11 +106,8 @@ def get_remote_image(name: Optional[str] = None,
|
|
|
97
106
|
id=pulumi.get(__ret__, 'id'),
|
|
98
107
|
name=pulumi.get(__ret__, 'name'),
|
|
99
108
|
repo_digest=pulumi.get(__ret__, 'repo_digest'))
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
@_utilities.lift_output_func(get_remote_image)
|
|
103
109
|
def get_remote_image_output(name: Optional[pulumi.Input[str]] = None,
|
|
104
|
-
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetRemoteImageResult]:
|
|
110
|
+
opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetRemoteImageResult]:
|
|
105
111
|
"""
|
|
106
112
|
`RemoteImage` provides details about a specific Docker Image which needs to be present on the Docker Host
|
|
107
113
|
|
|
@@ -111,13 +117,24 @@ def get_remote_image_output(name: Optional[pulumi.Input[str]] = None,
|
|
|
111
117
|
import pulumi
|
|
112
118
|
import pulumi_docker as docker
|
|
113
119
|
|
|
120
|
+
# uses the 'latest' tag
|
|
114
121
|
latest = docker.get_remote_image(name="nginx")
|
|
122
|
+
# uses a specific tag
|
|
115
123
|
specific = docker.get_remote_image(name="nginx:1.17.6")
|
|
124
|
+
# use the image digest
|
|
116
125
|
digest = docker.get_remote_image(name="nginx@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
|
|
126
|
+
# uses the tag and the image digest
|
|
117
127
|
tag_and_digest = docker.get_remote_image(name="nginx:1.19.1@sha256:36b74457bccb56fbf8b05f79c85569501b721d4db813b684391d63e02287c0b2")
|
|
118
128
|
```
|
|
119
129
|
|
|
120
130
|
|
|
121
131
|
:param str name: The name of the Docker image, including any tags or SHA256 repo digests.
|
|
122
132
|
"""
|
|
123
|
-
|
|
133
|
+
__args__ = dict()
|
|
134
|
+
__args__['name'] = name
|
|
135
|
+
opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
136
|
+
__ret__ = pulumi.runtime.invoke_output('docker:index/getRemoteImage:getRemoteImage', __args__, opts=opts, typ=GetRemoteImageResult)
|
|
137
|
+
return __ret__.apply(lambda __response__: GetRemoteImageResult(
|
|
138
|
+
id=pulumi.get(__response__, 'id'),
|
|
139
|
+
name=pulumi.get(__response__, 'name'),
|
|
140
|
+
repo_digest=pulumi.get(__response__, 'repo_digest')))
|
pulumi_docker/image.py
CHANGED
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
from ._enums import *
|
|
12
17
|
from ._inputs import *
|
|
@@ -111,16 +116,20 @@ class Image(pulumi.CustomResource):
|
|
|
111
116
|
def __init__(__self__,
|
|
112
117
|
resource_name: str,
|
|
113
118
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
114
|
-
build: Optional[pulumi.Input[
|
|
119
|
+
build: Optional[pulumi.Input[Union['DockerBuildArgs', 'DockerBuildArgsDict']]] = None,
|
|
115
120
|
build_on_preview: Optional[pulumi.Input[bool]] = None,
|
|
116
121
|
image_name: Optional[pulumi.Input[str]] = None,
|
|
117
|
-
registry: Optional[pulumi.Input[
|
|
122
|
+
registry: Optional[pulumi.Input[Union['RegistryArgs', 'RegistryArgsDict']]] = None,
|
|
118
123
|
skip_push: Optional[pulumi.Input[bool]] = None,
|
|
119
124
|
__props__=None):
|
|
120
125
|
"""
|
|
121
126
|
`Image` builds a Docker image and pushes it Docker and OCI compatible registries.
|
|
122
127
|
This resource enables running Docker builds as part of a Pulumi deployment.
|
|
123
128
|
|
|
129
|
+
Note: We recommend you migrate your images to the more modern [Docker
|
|
130
|
+
Build](https://www.pulumi.com/registry/packages/docker-build/) provider to get
|
|
131
|
+
the best possible support, features, and performance.
|
|
132
|
+
|
|
124
133
|
Note: This resource does not delete tags, locally or remotely, when destroyed.
|
|
125
134
|
|
|
126
135
|
## Image name
|
|
@@ -151,13 +160,11 @@ class Image(pulumi.CustomResource):
|
|
|
151
160
|
import pulumi_docker as docker
|
|
152
161
|
|
|
153
162
|
demo_image = docker.Image("demo-image",
|
|
154
|
-
build=
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
dockerfile="Dockerfile",
|
|
160
|
-
),
|
|
163
|
+
build={
|
|
164
|
+
"context": ".",
|
|
165
|
+
"dockerfile": "Dockerfile",
|
|
166
|
+
"platform": "linux/amd64",
|
|
167
|
+
},
|
|
161
168
|
image_name="username/image:tag1",
|
|
162
169
|
skip_push=True)
|
|
163
170
|
pulumi.export("imageName", demo_image.image_name)
|
|
@@ -168,10 +175,10 @@ class Image(pulumi.CustomResource):
|
|
|
168
175
|
import pulumi_docker as docker
|
|
169
176
|
|
|
170
177
|
demo_push_image = docker.Image("demo-push-image",
|
|
171
|
-
build=
|
|
172
|
-
context
|
|
173
|
-
dockerfile
|
|
174
|
-
|
|
178
|
+
build={
|
|
179
|
+
"context": ".",
|
|
180
|
+
"dockerfile": "Dockerfile",
|
|
181
|
+
},
|
|
175
182
|
image_name="docker.io/username/push-image:tag1")
|
|
176
183
|
pulumi.export("imageName", demo_push_image.image_name)
|
|
177
184
|
pulumi.export("repoDigest", demo_push_image.repo_digest)
|
|
@@ -185,31 +192,32 @@ class Image(pulumi.CustomResource):
|
|
|
185
192
|
ecr_repository = aws.ecr.Repository("ecr-repository", name="docker-repository")
|
|
186
193
|
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
|
187
194
|
my_app_image = docker.Image("my-app-image",
|
|
188
|
-
build=
|
|
189
|
-
args
|
|
195
|
+
build={
|
|
196
|
+
"args": {
|
|
190
197
|
"BUILDKIT_INLINE_CACHE": "1",
|
|
191
198
|
},
|
|
192
|
-
cache_from
|
|
193
|
-
images
|
|
194
|
-
|
|
195
|
-
context
|
|
196
|
-
dockerfile
|
|
197
|
-
|
|
199
|
+
"cache_from": {
|
|
200
|
+
"images": [ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest")],
|
|
201
|
+
},
|
|
202
|
+
"context": "app/",
|
|
203
|
+
"dockerfile": "app/Dockerfile",
|
|
204
|
+
},
|
|
198
205
|
image_name=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest"),
|
|
199
|
-
registry=
|
|
200
|
-
password
|
|
201
|
-
server
|
|
202
|
-
|
|
206
|
+
registry={
|
|
207
|
+
"password": pulumi.Output.secret(auth_token.password),
|
|
208
|
+
"server": ecr_repository.repository_url,
|
|
209
|
+
"username": auth_token.user_name,
|
|
210
|
+
})
|
|
203
211
|
pulumi.export("imageName", my_app_image.image_name)
|
|
204
212
|
```
|
|
205
213
|
|
|
206
214
|
:param str resource_name: The name of the resource.
|
|
207
215
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
208
|
-
:param pulumi.Input[
|
|
216
|
+
:param pulumi.Input[Union['DockerBuildArgs', 'DockerBuildArgsDict']] build: The Docker build context
|
|
209
217
|
:param pulumi.Input[bool] build_on_preview: A flag to build an image on preview
|
|
210
218
|
:param pulumi.Input[str] image_name: The image name, of the format repository[:tag], e.g. `docker.io/username/demo-image:v1`.
|
|
211
219
|
This reference is not unique to each build and push.For the unique manifest SHA of a pushed docker image, or the local image ID, please use `repoDigest`.
|
|
212
|
-
:param pulumi.Input[
|
|
220
|
+
:param pulumi.Input[Union['RegistryArgs', 'RegistryArgsDict']] registry: The registry to push the image to
|
|
213
221
|
:param pulumi.Input[bool] skip_push: A flag to skip a registry push.
|
|
214
222
|
"""
|
|
215
223
|
...
|
|
@@ -222,6 +230,10 @@ class Image(pulumi.CustomResource):
|
|
|
222
230
|
`Image` builds a Docker image and pushes it Docker and OCI compatible registries.
|
|
223
231
|
This resource enables running Docker builds as part of a Pulumi deployment.
|
|
224
232
|
|
|
233
|
+
Note: We recommend you migrate your images to the more modern [Docker
|
|
234
|
+
Build](https://www.pulumi.com/registry/packages/docker-build/) provider to get
|
|
235
|
+
the best possible support, features, and performance.
|
|
236
|
+
|
|
225
237
|
Note: This resource does not delete tags, locally or remotely, when destroyed.
|
|
226
238
|
|
|
227
239
|
## Image name
|
|
@@ -252,13 +264,11 @@ class Image(pulumi.CustomResource):
|
|
|
252
264
|
import pulumi_docker as docker
|
|
253
265
|
|
|
254
266
|
demo_image = docker.Image("demo-image",
|
|
255
|
-
build=
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
dockerfile="Dockerfile",
|
|
261
|
-
),
|
|
267
|
+
build={
|
|
268
|
+
"context": ".",
|
|
269
|
+
"dockerfile": "Dockerfile",
|
|
270
|
+
"platform": "linux/amd64",
|
|
271
|
+
},
|
|
262
272
|
image_name="username/image:tag1",
|
|
263
273
|
skip_push=True)
|
|
264
274
|
pulumi.export("imageName", demo_image.image_name)
|
|
@@ -269,10 +279,10 @@ class Image(pulumi.CustomResource):
|
|
|
269
279
|
import pulumi_docker as docker
|
|
270
280
|
|
|
271
281
|
demo_push_image = docker.Image("demo-push-image",
|
|
272
|
-
build=
|
|
273
|
-
context
|
|
274
|
-
dockerfile
|
|
275
|
-
|
|
282
|
+
build={
|
|
283
|
+
"context": ".",
|
|
284
|
+
"dockerfile": "Dockerfile",
|
|
285
|
+
},
|
|
276
286
|
image_name="docker.io/username/push-image:tag1")
|
|
277
287
|
pulumi.export("imageName", demo_push_image.image_name)
|
|
278
288
|
pulumi.export("repoDigest", demo_push_image.repo_digest)
|
|
@@ -286,21 +296,22 @@ class Image(pulumi.CustomResource):
|
|
|
286
296
|
ecr_repository = aws.ecr.Repository("ecr-repository", name="docker-repository")
|
|
287
297
|
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
|
288
298
|
my_app_image = docker.Image("my-app-image",
|
|
289
|
-
build=
|
|
290
|
-
args
|
|
299
|
+
build={
|
|
300
|
+
"args": {
|
|
291
301
|
"BUILDKIT_INLINE_CACHE": "1",
|
|
292
302
|
},
|
|
293
|
-
cache_from
|
|
294
|
-
images
|
|
295
|
-
|
|
296
|
-
context
|
|
297
|
-
dockerfile
|
|
298
|
-
|
|
303
|
+
"cache_from": {
|
|
304
|
+
"images": [ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest")],
|
|
305
|
+
},
|
|
306
|
+
"context": "app/",
|
|
307
|
+
"dockerfile": "app/Dockerfile",
|
|
308
|
+
},
|
|
299
309
|
image_name=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest"),
|
|
300
|
-
registry=
|
|
301
|
-
password
|
|
302
|
-
server
|
|
303
|
-
|
|
310
|
+
registry={
|
|
311
|
+
"password": pulumi.Output.secret(auth_token.password),
|
|
312
|
+
"server": ecr_repository.repository_url,
|
|
313
|
+
"username": auth_token.user_name,
|
|
314
|
+
})
|
|
304
315
|
pulumi.export("imageName", my_app_image.image_name)
|
|
305
316
|
```
|
|
306
317
|
|
|
@@ -319,10 +330,10 @@ class Image(pulumi.CustomResource):
|
|
|
319
330
|
def _internal_init(__self__,
|
|
320
331
|
resource_name: str,
|
|
321
332
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
322
|
-
build: Optional[pulumi.Input[
|
|
333
|
+
build: Optional[pulumi.Input[Union['DockerBuildArgs', 'DockerBuildArgsDict']]] = None,
|
|
323
334
|
build_on_preview: Optional[pulumi.Input[bool]] = None,
|
|
324
335
|
image_name: Optional[pulumi.Input[str]] = None,
|
|
325
|
-
registry: Optional[pulumi.Input[
|
|
336
|
+
registry: Optional[pulumi.Input[Union['RegistryArgs', 'RegistryArgsDict']]] = None,
|
|
326
337
|
skip_push: Optional[pulumi.Input[bool]] = None,
|
|
327
338
|
__props__=None):
|
|
328
339
|
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
|
@@ -347,6 +358,7 @@ class Image(pulumi.CustomResource):
|
|
|
347
358
|
__props__.__dict__["base_image_name"] = None
|
|
348
359
|
__props__.__dict__["context"] = None
|
|
349
360
|
__props__.__dict__["dockerfile"] = None
|
|
361
|
+
__props__.__dict__["platform"] = None
|
|
350
362
|
__props__.__dict__["registry_server"] = None
|
|
351
363
|
__props__.__dict__["repo_digest"] = None
|
|
352
364
|
alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="docker:image:Image")])
|
|
@@ -377,6 +389,7 @@ class Image(pulumi.CustomResource):
|
|
|
377
389
|
__props__.__dict__["context"] = None
|
|
378
390
|
__props__.__dict__["dockerfile"] = None
|
|
379
391
|
__props__.__dict__["image_name"] = None
|
|
392
|
+
__props__.__dict__["platform"] = None
|
|
380
393
|
__props__.__dict__["registry_server"] = None
|
|
381
394
|
__props__.__dict__["repo_digest"] = None
|
|
382
395
|
return Image(resource_name, opts=opts, __props__=__props__)
|
|
@@ -413,6 +426,14 @@ class Image(pulumi.CustomResource):
|
|
|
413
426
|
"""
|
|
414
427
|
return pulumi.get(self, "image_name")
|
|
415
428
|
|
|
429
|
+
@property
|
|
430
|
+
@pulumi.getter
|
|
431
|
+
def platform(self) -> pulumi.Output[Optional[str]]:
|
|
432
|
+
"""
|
|
433
|
+
The image's architecture and OS
|
|
434
|
+
"""
|
|
435
|
+
return pulumi.get(self, "platform")
|
|
436
|
+
|
|
416
437
|
@property
|
|
417
438
|
@pulumi.getter(name="registryServer")
|
|
418
439
|
def registry_server(self) -> pulumi.Output[str]:
|