Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9c3284f40 | ||
|
|
81a7aa4ec4 |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,5 +1,15 @@
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Refreshing an `Index` resource will no longer fail if its stored credentials
|
||||||
|
have expired. (https://github.com/pulumi/pulumi-docker-build/pull/194)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Local and tar exporters will now trigger an update if an export doesn't exist
|
||||||
|
at the expected path. (https://github.com/pulumi/pulumi-docker-build/pull/195)
|
||||||
|
|
||||||
## 0.0.5 (2024-08-08)
|
## 0.0.5 (2024-08-08)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
4
go.mod
4
go.mod
@@ -24,7 +24,7 @@ require (
|
|||||||
github.com/pulumi/pulumi/sdk/nodejs/cmd/pulumi-language-nodejs/v3 v3.0.0-20240805173038-c428a91a4c3c
|
github.com/pulumi/pulumi/sdk/nodejs/cmd/pulumi-language-nodejs/v3 v3.0.0-20240805173038-c428a91a4c3c
|
||||||
github.com/pulumi/pulumi/sdk/python/cmd/pulumi-language-python/v3 v3.0.0-20240805173038-c428a91a4c3c
|
github.com/pulumi/pulumi/sdk/python/cmd/pulumi-language-python/v3 v3.0.0-20240805173038-c428a91a4c3c
|
||||||
github.com/pulumi/pulumi/sdk/v3 v3.128.0
|
github.com/pulumi/pulumi/sdk/v3 v3.128.0
|
||||||
github.com/regclient/regclient v0.6.1
|
github.com/regclient/regclient v0.7.1
|
||||||
github.com/sirupsen/logrus v1.9.3
|
github.com/sirupsen/logrus v1.9.3
|
||||||
github.com/spf13/afero v1.11.0
|
github.com/spf13/afero v1.11.0
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
@@ -460,7 +460,7 @@ require (
|
|||||||
golang.org/x/net v0.26.0 // indirect
|
golang.org/x/net v0.26.0 // indirect
|
||||||
golang.org/x/oauth2 v0.18.0 // indirect
|
golang.org/x/oauth2 v0.18.0 // indirect
|
||||||
golang.org/x/sync v0.7.0 // indirect
|
golang.org/x/sync v0.7.0 // indirect
|
||||||
golang.org/x/sys v0.22.0 // indirect
|
golang.org/x/sys v0.24.0 // indirect
|
||||||
golang.org/x/term v0.22.0 // indirect
|
golang.org/x/term v0.22.0 // indirect
|
||||||
golang.org/x/text v0.16.0 // indirect
|
golang.org/x/text v0.16.0 // indirect
|
||||||
golang.org/x/time v0.5.0 // indirect
|
golang.org/x/time v0.5.0 // indirect
|
||||||
|
|||||||
8
go.sum
8
go.sum
@@ -969,8 +969,8 @@ github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl
|
|||||||
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0=
|
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0=
|
||||||
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs=
|
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs=
|
||||||
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ=
|
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ=
|
||||||
github.com/regclient/regclient v0.6.1 h1:4PxrGxMXrLpPrSaet8QZl568CVOolyHyukLL9UyogoU=
|
github.com/regclient/regclient v0.7.1 h1:qEsJrTmZd98fZKjueAbrZCSNGU+ifnr6xjlSAs3WOPs=
|
||||||
github.com/regclient/regclient v0.6.1/go.mod h1:hCKbRHYMx6LJntAhXzWVV7Oxyn9DzNVJoOKJaSnU5BM=
|
github.com/regclient/regclient v0.7.1/go.mod h1:+w/BFtJuw0h0nzIw/z2+1FuA2/dVXBzDq4rYmziJpMc=
|
||||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||||
@@ -1378,8 +1378,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|||||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
|
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
|
||||||
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -46,27 +46,27 @@ import pulumi_docker_build as docker_build
|
|||||||
ecr_repository = aws.ecr.Repository("ecr-repository")
|
ecr_repository = aws.ecr.Repository("ecr-repository")
|
||||||
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
||||||
my_image = docker_build.Image("my-image",
|
my_image = docker_build.Image("my-image",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
"ref": ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
image_manifest=True,
|
"image_manifest": True,
|
||||||
oci_media_types=True,
|
"oci_media_types": True,
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
"ref": ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="./app",
|
"location": "./app",
|
||||||
),
|
},
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker_build.RegistryArgs(
|
registries=[{
|
||||||
address=ecr_repository.repository_url,
|
"address": ecr_repository.repository_url,
|
||||||
password=auth_token.password,
|
"password": auth_token.password,
|
||||||
username=auth_token.user_name,
|
"username": auth_token.user_name,
|
||||||
)],
|
}],
|
||||||
tags=[ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest")])
|
tags=[ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest")])
|
||||||
pulumi.export("ref", my_image.ref)
|
pulumi.export("ref", my_image.ref)
|
||||||
```
|
```
|
||||||
@@ -330,9 +330,9 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[
|
platforms=[
|
||||||
docker_build.Platform.PLAN9_AMD64,
|
docker_build.Platform.PLAN9_AMD64,
|
||||||
docker_build.Platform.PLAN9_386,
|
docker_build.Platform.PLAN9_386,
|
||||||
@@ -468,15 +468,15 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker_build.RegistryArgs(
|
registries=[{
|
||||||
address="docker.io",
|
"address": "docker.io",
|
||||||
password=docker_hub_password,
|
"password": docker_hub_password,
|
||||||
username="pulumibot",
|
"username": "pulumibot",
|
||||||
)],
|
}],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0"])
|
tags=["docker.io/pulumi/pulumi:3.107.0"])
|
||||||
pulumi.export("ref", my_image["ref"])
|
pulumi.export("ref", my_image["ref"])
|
||||||
```
|
```
|
||||||
@@ -642,20 +642,20 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
local=docker_build.CacheFromLocalArgs(
|
"local": {
|
||||||
src="tmp/cache",
|
"src": "tmp/cache",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
local=docker_build.CacheToLocalArgs(
|
"local": {
|
||||||
dest="tmp/cache",
|
"dest": "tmp/cache",
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
```csharp
|
```csharp
|
||||||
@@ -827,12 +827,12 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
builder=docker_build.BuilderConfigArgs(
|
builder={
|
||||||
name="cloud-builder-name",
|
"name": "cloud-builder-name",
|
||||||
),
|
},
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
exec_=True,
|
exec_=True,
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
@@ -966,9 +966,9 @@ image = docker_build.Image("image",
|
|||||||
build_args={
|
build_args={
|
||||||
"SET_ME_TO_TRUE": "true",
|
"SET_ME_TO_TRUE": "true",
|
||||||
},
|
},
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
```csharp
|
```csharp
|
||||||
@@ -1089,9 +1089,9 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False,
|
push=False,
|
||||||
target="build-me")
|
target="build-me")
|
||||||
```
|
```
|
||||||
@@ -1211,14 +1211,14 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
named={
|
"named": {
|
||||||
"golang:latest": docker_build.ContextArgs(
|
"golang_latest": {
|
||||||
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
"location": "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||||
),
|
},
|
||||||
},
|
},
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
```csharp
|
```csharp
|
||||||
@@ -1344,9 +1344,9 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
"location": "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
```csharp
|
```csharp
|
||||||
@@ -1461,14 +1461,14 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
dockerfile=docker_build.DockerfileArgs(
|
dockerfile={
|
||||||
inline="""FROM busybox
|
"inline": """FROM busybox
|
||||||
COPY hello.c ./
|
COPY hello.c ./
|
||||||
""",
|
""",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
```csharp
|
```csharp
|
||||||
@@ -1601,12 +1601,12 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="https://github.com/docker-library/hello-world.git",
|
"location": "https://github.com/docker-library/hello-world.git",
|
||||||
),
|
},
|
||||||
dockerfile=docker_build.DockerfileArgs(
|
dockerfile={
|
||||||
location="app/Dockerfile",
|
"location": "app/Dockerfile",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
```csharp
|
```csharp
|
||||||
@@ -1734,14 +1734,14 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
exports=[docker_build.ExportArgs(
|
exports=[{
|
||||||
docker=docker_build.ExportDockerArgs(
|
"docker": {
|
||||||
tar=True,
|
"tar": True,
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
```csharp
|
```csharp
|
||||||
|
|||||||
@@ -57,37 +57,37 @@ import pulumi
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
amd64 = docker_build.Image("amd64",
|
amd64 = docker_build.Image("amd64",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
"ref": "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
"ref": "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[docker_build.Platform.LINUX_AMD64],
|
platforms=[docker_build.Platform.LINUX_AMD64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||||
arm64 = docker_build.Image("arm64",
|
arm64 = docker_build.Image("arm64",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
"ref": "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
"ref": "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[docker_build.Platform.LINUX_ARM64],
|
platforms=[docker_build.Platform.LINUX_ARM64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||||
index = docker_build.Index("index",
|
index = docker_build.Index("index",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package internal
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -353,6 +354,19 @@ func (e *ExportLocal) Annotate(a infer.Annotator) {
|
|||||||
a.Describe(&e.Dest, "Output path.")
|
a.Describe(&e.Dest, "Output path.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exists returns true if the exported directory exists and is populated with
|
||||||
|
// some files.
|
||||||
|
func (e *ExportLocal) Exists() bool {
|
||||||
|
if e == nil {
|
||||||
|
return true // Degenerate case.
|
||||||
|
}
|
||||||
|
files, err := os.ReadDir(e.Dest)
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return len(files) > 0
|
||||||
|
}
|
||||||
|
|
||||||
// ExportTar is an export that uses the tar format for exporting.
|
// ExportTar is an export that uses the tar format for exporting.
|
||||||
type ExportTar struct {
|
type ExportTar struct {
|
||||||
ExportLocal
|
ExportLocal
|
||||||
@@ -365,6 +379,15 @@ func (e *ExportTar) String() string {
|
|||||||
return "type=tar,dest=" + e.Dest
|
return "type=tar,dest=" + e.Dest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exists returns true if a file exists at the expected path.
|
||||||
|
func (e *ExportTar) Exists() bool {
|
||||||
|
if e == nil {
|
||||||
|
return true // Degenerate case.
|
||||||
|
}
|
||||||
|
_, err := os.Stat(e.Dest)
|
||||||
|
return err == nil
|
||||||
|
}
|
||||||
|
|
||||||
// ExportWithOCI is an export that support OCI media types.
|
// ExportWithOCI is an export that support OCI media types.
|
||||||
type ExportWithOCI struct {
|
type ExportWithOCI struct {
|
||||||
OCI *bool `pulumi:"ociMediaTypes,optional"`
|
OCI *bool `pulumi:"ociMediaTypes,optional"`
|
||||||
|
|||||||
@@ -802,6 +802,7 @@ func (i *Image) Read(
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint:gocritic // Bytes aren't copied in a hot path.
|
||||||
for _, d := range descriptors {
|
for _, d := range descriptors {
|
||||||
if d.Platform != nil && d.Platform.Architecture == "unknown" {
|
if d.Platform != nil && d.Platform.Architecture == "unknown" {
|
||||||
// Ignore cache manifests.
|
// Ignore cache manifests.
|
||||||
@@ -912,6 +913,12 @@ func (*Image) Diff(
|
|||||||
if fmt.Sprint(olds.Exports) != fmt.Sprint(news.Exports) {
|
if fmt.Sprint(olds.Exports) != fmt.Sprint(news.Exports) {
|
||||||
diff["exports"] = update
|
diff["exports"] = update
|
||||||
}
|
}
|
||||||
|
// Confirm local exports exist.
|
||||||
|
for idx, e := range news.Exports {
|
||||||
|
if !e.Local.Exists() || !e.Tar.Exists() {
|
||||||
|
diff[fmt.Sprintf("exports[%d]", idx)] = update
|
||||||
|
}
|
||||||
|
}
|
||||||
if !reflect.DeepEqual(olds.Labels, news.Labels) {
|
if !reflect.DeepEqual(olds.Labels, news.Labels) {
|
||||||
diff["labels"] = update
|
diff["labels"] = update
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -757,6 +757,38 @@ func TestImageDiff(t *testing.T) {
|
|||||||
},
|
},
|
||||||
wantChanges: true,
|
wantChanges: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "diff if local export doesn't exist",
|
||||||
|
olds: func(t *testing.T, state ImageState) ImageState {
|
||||||
|
state.Exports = []Export{
|
||||||
|
{Local: &ExportLocal{Dest: "not-real"}},
|
||||||
|
}
|
||||||
|
return state
|
||||||
|
},
|
||||||
|
news: func(_ *testing.T, args ImageArgs) ImageArgs {
|
||||||
|
args.Exports = []Export{
|
||||||
|
{Local: &ExportLocal{Dest: "not-real"}},
|
||||||
|
}
|
||||||
|
return args
|
||||||
|
},
|
||||||
|
wantChanges: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "diff if tar export doesn't exist",
|
||||||
|
olds: func(t *testing.T, state ImageState) ImageState {
|
||||||
|
state.Exports = []Export{
|
||||||
|
{Tar: &ExportTar{ExportLocal: ExportLocal{Dest: "not-real"}}},
|
||||||
|
}
|
||||||
|
return state
|
||||||
|
},
|
||||||
|
news: func(_ *testing.T, args ImageArgs) ImageArgs {
|
||||||
|
args.Exports = []Export{
|
||||||
|
{Tar: &ExportTar{ExportLocal: ExportLocal{Dest: "not-real"}}},
|
||||||
|
}
|
||||||
|
return args
|
||||||
|
},
|
||||||
|
wantChanges: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
s := newServer(nil)
|
s := newServer(nil)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ package internal
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -23,6 +24,8 @@ import (
|
|||||||
// For examples/docs.
|
// For examples/docs.
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
|
||||||
|
"github.com/regclient/regclient/types/errs"
|
||||||
|
|
||||||
provider "github.com/pulumi/pulumi-go-provider"
|
provider "github.com/pulumi/pulumi-go-provider"
|
||||||
"github.com/pulumi/pulumi-go-provider/infer"
|
"github.com/pulumi/pulumi-go-provider/infer"
|
||||||
"github.com/pulumi/pulumi/sdk/v3/go/common/resource"
|
"github.com/pulumi/pulumi/sdk/v3/go/common/resource"
|
||||||
@@ -194,12 +197,12 @@ func (i *Index) Read(
|
|||||||
provider.GetLogger(ctx).Debug("reading index with tag " + input.Tag)
|
provider.GetLogger(ctx).Debug("reading index with tag " + input.Tag)
|
||||||
|
|
||||||
digest, err := cli.ManifestInspect(ctx, input.Tag)
|
digest, err := cli.ManifestInspect(ctx, input.Tag)
|
||||||
if err != nil && strings.Contains(err.Error(), "No such manifest:") && input.isPushed() {
|
if errors.Is(err, errs.ErrNotFound) {
|
||||||
// A remote tag was expected but isn't there -- delete the resource.
|
// A remote tag was expected but isn't there -- delete the resource.
|
||||||
return "", input, state, err
|
return "", input, state, nil
|
||||||
}
|
}
|
||||||
if err != nil && strings.Contains(err.Error(), "No such manifest:") && !input.isPushed() {
|
if errors.Is(err, errs.ErrHTTPUnauthorized) {
|
||||||
// Nothing was pushed, so just use the tag without digest..
|
provider.GetLogger(ctx).Warning("invalid credentials, skipping")
|
||||||
return name, input, state, nil
|
return name, input, state, nil
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/regclient/regclient/types/errs"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
"go.uber.org/mock/gomock"
|
||||||
|
|
||||||
provider "github.com/pulumi/pulumi-go-provider"
|
provider "github.com/pulumi/pulumi-go-provider"
|
||||||
"github.com/pulumi/pulumi-go-provider/integration"
|
"github.com/pulumi/pulumi-go-provider/integration"
|
||||||
@@ -84,6 +86,40 @@ func TestIndexLifecycle(t *testing.T) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "expired credentials",
|
||||||
|
client: func(t *testing.T) Client {
|
||||||
|
ctrl := gomock.NewController(t)
|
||||||
|
c := NewMockClient(ctrl)
|
||||||
|
c.EXPECT().ManifestCreate(gomock.Any(), true, gomock.Any(), gomock.Any())
|
||||||
|
c.EXPECT().ManifestInspect(gomock.Any(), gomock.Any()).Return("", errs.ErrHTTPUnauthorized)
|
||||||
|
c.EXPECT().ManifestDelete(gomock.Any(), gomock.Any()).Return(nil)
|
||||||
|
return c
|
||||||
|
},
|
||||||
|
op: func(t *testing.T) integration.Operation {
|
||||||
|
return integration.Operation{
|
||||||
|
Inputs: resource.PropertyMap{
|
||||||
|
"tag": resource.NewStringProperty(
|
||||||
|
"docker.io/pulumibot/buildkit-e2e:manifest",
|
||||||
|
),
|
||||||
|
"sources": resource.NewArrayProperty([]resource.PropertyValue{
|
||||||
|
resource.NewStringProperty("docker.io/pulumibot/buildkit-e2e:arm64"),
|
||||||
|
resource.NewStringProperty("docker.io/pulumibot/buildkit-e2e:amd64"),
|
||||||
|
}),
|
||||||
|
"push": resource.NewBoolProperty(true),
|
||||||
|
"registry": resource.NewObjectProperty(resource.PropertyMap{
|
||||||
|
"address": resource.NewStringProperty("docker.io"),
|
||||||
|
"username": resource.NewStringProperty("pulumibot"),
|
||||||
|
"password": resource.NewSecretProperty(&resource.Secret{
|
||||||
|
Element: resource.NewStringProperty(
|
||||||
|
os.Getenv("DOCKER_HUB_PASSWORD"),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|||||||
2
sdk/go/dockerbuild/go.mod
generated
2
sdk/go/dockerbuild/go.mod
generated
@@ -88,7 +88,7 @@ require (
|
|||||||
golang.org/x/mod v0.18.0 // indirect
|
golang.org/x/mod v0.18.0 // indirect
|
||||||
golang.org/x/net v0.26.0 // indirect
|
golang.org/x/net v0.26.0 // indirect
|
||||||
golang.org/x/sync v0.7.0 // indirect
|
golang.org/x/sync v0.7.0 // indirect
|
||||||
golang.org/x/sys v0.22.0 // indirect
|
golang.org/x/sys v0.24.0 // indirect
|
||||||
golang.org/x/term v0.22.0 // indirect
|
golang.org/x/term v0.22.0 // indirect
|
||||||
golang.org/x/text v0.16.0 // indirect
|
golang.org/x/text v0.16.0 // indirect
|
||||||
golang.org/x/tools v0.22.0 // indirect
|
golang.org/x/tools v0.22.0 // indirect
|
||||||
|
|||||||
4
sdk/go/dockerbuild/go.sum
generated
4
sdk/go/dockerbuild/go.sum
generated
@@ -273,8 +273,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|||||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
|
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
|
||||||
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
||||||
|
|||||||
348
sdk/python/pulumi_docker_build/image.py
generated
348
sdk/python/pulumi_docker_build/image.py
generated
@@ -718,27 +718,27 @@ class Image(pulumi.CustomResource):
|
|||||||
ecr_repository = aws.ecr.Repository("ecr-repository")
|
ecr_repository = aws.ecr.Repository("ecr-repository")
|
||||||
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
||||||
my_image = docker_build.Image("my-image",
|
my_image = docker_build.Image("my-image",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
"ref": ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
image_manifest=True,
|
"image_manifest": True,
|
||||||
oci_media_types=True,
|
"oci_media_types": True,
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
"ref": ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="./app",
|
"location": "./app",
|
||||||
),
|
},
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker_build.RegistryArgs(
|
registries=[{
|
||||||
address=ecr_repository.repository_url,
|
"address": ecr_repository.repository_url,
|
||||||
password=auth_token.password,
|
"password": auth_token.password,
|
||||||
username=auth_token.user_name,
|
"username": auth_token.user_name,
|
||||||
)],
|
}],
|
||||||
tags=[ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest")])
|
tags=[ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest")])
|
||||||
pulumi.export("ref", my_image.ref)
|
pulumi.export("ref", my_image.ref)
|
||||||
```
|
```
|
||||||
@@ -748,9 +748,9 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[
|
platforms=[
|
||||||
docker_build.Platform.PLAN9_AMD64,
|
docker_build.Platform.PLAN9_AMD64,
|
||||||
docker_build.Platform.PLAN9_386,
|
docker_build.Platform.PLAN9_386,
|
||||||
@@ -763,15 +763,15 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker_build.RegistryArgs(
|
registries=[{
|
||||||
address="docker.io",
|
"address": "docker.io",
|
||||||
password=docker_hub_password,
|
"password": docker_hub_password,
|
||||||
username="pulumibot",
|
"username": "pulumibot",
|
||||||
)],
|
}],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0"])
|
tags=["docker.io/pulumi/pulumi:3.107.0"])
|
||||||
pulumi.export("ref", my_image["ref"])
|
pulumi.export("ref", my_image["ref"])
|
||||||
```
|
```
|
||||||
@@ -781,20 +781,20 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
local=docker_build.CacheFromLocalArgs(
|
"local": {
|
||||||
src="tmp/cache",
|
"src": "tmp/cache",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
local=docker_build.CacheToLocalArgs(
|
"local": {
|
||||||
dest="tmp/cache",
|
"dest": "tmp/cache",
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Docker Build Cloud
|
### Docker Build Cloud
|
||||||
@@ -803,12 +803,12 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
builder=docker_build.BuilderConfigArgs(
|
builder={
|
||||||
name="cloud-builder-name",
|
"name": "cloud-builder-name",
|
||||||
),
|
},
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
exec_=True,
|
exec_=True,
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
@@ -821,9 +821,9 @@ class Image(pulumi.CustomResource):
|
|||||||
build_args={
|
build_args={
|
||||||
"SET_ME_TO_TRUE": "true",
|
"SET_ME_TO_TRUE": "true",
|
||||||
},
|
},
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Build target
|
### Build target
|
||||||
@@ -832,9 +832,9 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False,
|
push=False,
|
||||||
target="build-me")
|
target="build-me")
|
||||||
```
|
```
|
||||||
@@ -844,14 +844,14 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
named={
|
"named": {
|
||||||
"golang:latest": docker_build.ContextArgs(
|
"golang_latest": {
|
||||||
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
"location": "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||||
),
|
},
|
||||||
},
|
},
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Remote context
|
### Remote context
|
||||||
@@ -860,9 +860,9 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
"location": "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Inline Dockerfile
|
### Inline Dockerfile
|
||||||
@@ -871,14 +871,14 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
dockerfile=docker_build.DockerfileArgs(
|
dockerfile={
|
||||||
inline=\"\"\"FROM busybox
|
"inline": \"\"\"FROM busybox
|
||||||
COPY hello.c ./
|
COPY hello.c ./
|
||||||
\"\"\",
|
\"\"\",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Remote context
|
### Remote context
|
||||||
@@ -887,12 +887,12 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="https://github.com/docker-library/hello-world.git",
|
"location": "https://github.com/docker-library/hello-world.git",
|
||||||
),
|
},
|
||||||
dockerfile=docker_build.DockerfileArgs(
|
dockerfile={
|
||||||
location="app/Dockerfile",
|
"location": "app/Dockerfile",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Local export
|
### Local export
|
||||||
@@ -901,14 +901,14 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
exports=[docker_build.ExportArgs(
|
exports=[{
|
||||||
docker=docker_build.ExportDockerArgs(
|
"docker": {
|
||||||
tar=True,
|
"tar": True,
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -1156,27 +1156,27 @@ class Image(pulumi.CustomResource):
|
|||||||
ecr_repository = aws.ecr.Repository("ecr-repository")
|
ecr_repository = aws.ecr.Repository("ecr-repository")
|
||||||
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
||||||
my_image = docker_build.Image("my-image",
|
my_image = docker_build.Image("my-image",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
"ref": ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
image_manifest=True,
|
"image_manifest": True,
|
||||||
oci_media_types=True,
|
"oci_media_types": True,
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
"ref": ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="./app",
|
"location": "./app",
|
||||||
),
|
},
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker_build.RegistryArgs(
|
registries=[{
|
||||||
address=ecr_repository.repository_url,
|
"address": ecr_repository.repository_url,
|
||||||
password=auth_token.password,
|
"password": auth_token.password,
|
||||||
username=auth_token.user_name,
|
"username": auth_token.user_name,
|
||||||
)],
|
}],
|
||||||
tags=[ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest")])
|
tags=[ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:latest")])
|
||||||
pulumi.export("ref", my_image.ref)
|
pulumi.export("ref", my_image.ref)
|
||||||
```
|
```
|
||||||
@@ -1186,9 +1186,9 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[
|
platforms=[
|
||||||
docker_build.Platform.PLAN9_AMD64,
|
docker_build.Platform.PLAN9_AMD64,
|
||||||
docker_build.Platform.PLAN9_386,
|
docker_build.Platform.PLAN9_386,
|
||||||
@@ -1201,15 +1201,15 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker_build.RegistryArgs(
|
registries=[{
|
||||||
address="docker.io",
|
"address": "docker.io",
|
||||||
password=docker_hub_password,
|
"password": docker_hub_password,
|
||||||
username="pulumibot",
|
"username": "pulumibot",
|
||||||
)],
|
}],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0"])
|
tags=["docker.io/pulumi/pulumi:3.107.0"])
|
||||||
pulumi.export("ref", my_image["ref"])
|
pulumi.export("ref", my_image["ref"])
|
||||||
```
|
```
|
||||||
@@ -1219,20 +1219,20 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
local=docker_build.CacheFromLocalArgs(
|
"local": {
|
||||||
src="tmp/cache",
|
"src": "tmp/cache",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
local=docker_build.CacheToLocalArgs(
|
"local": {
|
||||||
dest="tmp/cache",
|
"dest": "tmp/cache",
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Docker Build Cloud
|
### Docker Build Cloud
|
||||||
@@ -1241,12 +1241,12 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
builder=docker_build.BuilderConfigArgs(
|
builder={
|
||||||
name="cloud-builder-name",
|
"name": "cloud-builder-name",
|
||||||
),
|
},
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
exec_=True,
|
exec_=True,
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
@@ -1259,9 +1259,9 @@ class Image(pulumi.CustomResource):
|
|||||||
build_args={
|
build_args={
|
||||||
"SET_ME_TO_TRUE": "true",
|
"SET_ME_TO_TRUE": "true",
|
||||||
},
|
},
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Build target
|
### Build target
|
||||||
@@ -1270,9 +1270,9 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
push=False,
|
push=False,
|
||||||
target="build-me")
|
target="build-me")
|
||||||
```
|
```
|
||||||
@@ -1282,14 +1282,14 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
named={
|
"named": {
|
||||||
"golang:latest": docker_build.ContextArgs(
|
"golang_latest": {
|
||||||
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
"location": "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||||
),
|
},
|
||||||
},
|
},
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Remote context
|
### Remote context
|
||||||
@@ -1298,9 +1298,9 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
"location": "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Inline Dockerfile
|
### Inline Dockerfile
|
||||||
@@ -1309,14 +1309,14 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
dockerfile=docker_build.DockerfileArgs(
|
dockerfile={
|
||||||
inline=\"\"\"FROM busybox
|
"inline": \"\"\"FROM busybox
|
||||||
COPY hello.c ./
|
COPY hello.c ./
|
||||||
\"\"\",
|
\"\"\",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Remote context
|
### Remote context
|
||||||
@@ -1325,12 +1325,12 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="https://github.com/docker-library/hello-world.git",
|
"location": "https://github.com/docker-library/hello-world.git",
|
||||||
),
|
},
|
||||||
dockerfile=docker_build.DockerfileArgs(
|
dockerfile={
|
||||||
location="app/Dockerfile",
|
"location": "app/Dockerfile",
|
||||||
),
|
},
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
### Local export
|
### Local export
|
||||||
@@ -1339,14 +1339,14 @@ class Image(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
image = docker_build.Image("image",
|
image = docker_build.Image("image",
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
exports=[docker_build.ExportArgs(
|
exports=[{
|
||||||
docker=docker_build.ExportDockerArgs(
|
"docker": {
|
||||||
tar=True,
|
"tar": True,
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
push=False)
|
push=False)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
112
sdk/python/pulumi_docker_build/index.py
generated
112
sdk/python/pulumi_docker_build/index.py
generated
@@ -131,37 +131,37 @@ class Index(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
amd64 = docker_build.Image("amd64",
|
amd64 = docker_build.Image("amd64",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
"ref": "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
"ref": "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[docker_build.Platform.LINUX_AMD64],
|
platforms=[docker_build.Platform.LINUX_AMD64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||||
arm64 = docker_build.Image("arm64",
|
arm64 = docker_build.Image("arm64",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
"ref": "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
"ref": "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[docker_build.Platform.LINUX_ARM64],
|
platforms=[docker_build.Platform.LINUX_ARM64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||||
index = docker_build.Index("index",
|
index = docker_build.Index("index",
|
||||||
@@ -218,37 +218,37 @@ class Index(pulumi.CustomResource):
|
|||||||
import pulumi_docker_build as docker_build
|
import pulumi_docker_build as docker_build
|
||||||
|
|
||||||
amd64 = docker_build.Image("amd64",
|
amd64 = docker_build.Image("amd64",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
"ref": "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
"ref": "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[docker_build.Platform.LINUX_AMD64],
|
platforms=[docker_build.Platform.LINUX_AMD64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||||
arm64 = docker_build.Image("arm64",
|
arm64 = docker_build.Image("arm64",
|
||||||
cache_from=[docker_build.CacheFromArgs(
|
cache_from=[{
|
||||||
registry=docker_build.CacheFromRegistryArgs(
|
"registry": {
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
"ref": "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
cache_to=[docker_build.CacheToArgs(
|
cache_to=[{
|
||||||
registry=docker_build.CacheToRegistryArgs(
|
"registry": {
|
||||||
mode=docker_build.CacheMode.MAX,
|
"mode": docker_build.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
"ref": "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
},
|
||||||
)],
|
}],
|
||||||
context=docker_build.BuildContextArgs(
|
context={
|
||||||
location="app",
|
"location": "app",
|
||||||
),
|
},
|
||||||
platforms=[docker_build.Platform.LINUX_ARM64],
|
platforms=[docker_build.Platform.LINUX_ARM64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||||
index = docker_build.Index("index",
|
index = docker_build.Index("index",
|
||||||
|
|||||||
Reference in New Issue
Block a user