Skip to content

Commit

Permalink
Chore: regenerate SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFriel committed Apr 24, 2023
1 parent 59e11c0 commit fd3df1c
Show file tree
Hide file tree
Showing 19 changed files with 368 additions and 11 deletions.
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-resource-docker/schema.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions provider/pkg/docs-gen/examples/image.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{% examples %}}
## Example Usage
{{% example %}}
### A Docker image build
Expand Down Expand Up @@ -392,3 +393,4 @@ public class App {
}
```
{{% /example %}}
{{% /examples %}}
1 change: 1 addition & 0 deletions sdk/dotnet/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Pulumi.Docker
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/dotnet/GetNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static class GetNetwork
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down Expand Up @@ -47,6 +48,7 @@ public static Task<GetNetworkResult> InvokeAsync(GetNetworkArgs args, InvokeOpti
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/dotnet/GetRegistryImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static class GetRegistryImage
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down Expand Up @@ -56,6 +57,7 @@ public static Task<GetRegistryImageResult> InvokeAsync(GetRegistryImageArgs args
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/dotnet/GetRemoteImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static class GetRemoteImage
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down Expand Up @@ -62,6 +63,7 @@ public static Task<GetRemoteImageResult> InvokeAsync(GetRemoteImageArgs args, In
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
70 changes: 69 additions & 1 deletion sdk/dotnet/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@
namespace Pulumi.Docker
{
/// <summary>
/// Builds a Docker Image and pushes to a Docker registry.
/// `Image` builds a Docker image and pushes it Docker and OCI compatible registries.
/// This resource enables running Docker builds as part of a Pulumi deployment.
///
/// Note: This resource does not delete tags, locally or remotely, when destroyed.
///
/// ## Cross-platform builds
///
/// The Image resource supports cross-platform builds when the [Docker engine has cross-platform support enabled via emulators](https://docs.docker.com/build/building/multi-platform/#building-multi-platform-images).
/// The Image resource currently supports providing only a single operating system and architecture in the `platform` field, e.g.: `linux/amd64`.
/// To enable this support, you may need to install the emulators in the environment running your Pulumi program.
///
/// If you are using Linux, you may be using Docker Engine or Docker Desktop for Linux, depending on how you have installed Docker. The [FAQ for Docker Desktop for Linux](https://docs.docker.com/desktop/faqs/linuxfaqs/#context) describes the differences and how to select which Docker context is in use.
///
/// * For local development using Docker Desktop, this is enabled by default.
/// * For systems using Docker Engine, install the QEMU binaries and register them with using the docker image from [github.com/tonistiigi/binfmt](https://github.com/tonistiigi/binfmt):
/// * In a GitHub Actions workflow, the [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) can be used instead by adding this step to your workflow file. Example workflow usage:
///
/// ## Example Usage
/// ### A Docker image build
Expand Down Expand Up @@ -40,6 +55,59 @@ namespace Pulumi.Docker
/// });
///
/// ```
/// ### Docker image build using caching with AWS Elastic Container Registry
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Aws = Pulumi.Aws;
/// using Docker = Pulumi.Docker;
///
/// return await Deployment.RunAsync(() =&gt;
/// {
/// var ecrRepository = new Aws.Ecr.Repository("ecr-repository", new()
/// {
/// Name = "docker-repository",
/// });
///
/// var authToken = Aws.Ecr.GetAuthorizationToken.Invoke(new()
/// {
/// RegistryId = ecrRepository.RegistryId,
/// });
///
/// var myAppImage = new Docker.Image("my-app-image", new()
/// {
/// Build = new Docker.Inputs.DockerBuildArgs
/// {
/// Args =
/// {
/// { "BUILDKIT_INLINE_CACHE", "1" },
/// },
/// CacheFrom = new Docker.Inputs.CacheFromArgs
/// {
/// Images = new[]
/// {
/// ecrRepository.RepositoryUrl.Apply(repositoryUrl =&gt; $"{repositoryUrl}:latest"),
/// },
/// },
/// Context = "app/",
/// Dockerfile = "Dockerfile",
/// },
/// ImageName = ecrRepository.RepositoryUrl.Apply(repositoryUrl =&gt; $"{repositoryUrl}:latest"),
/// Registry = new Docker.Inputs.RegistryArgs
/// {
/// Password = Output.CreateSecret(authToken.Apply(getAuthorizationTokenResult =&gt; getAuthorizationTokenResult.Password)),
/// Server = ecrRepository.RepositoryUrl,
/// },
/// });
///
/// return new Dictionary&lt;string, object?&gt;
/// {
/// ["imageName"] = myAppImage.ImageName,
/// };
/// });
///
/// ```
/// </summary>
[DockerResourceType("docker:index/image:Image")]
public partial class Image : global::Pulumi.CustomResource
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Pulumi.Docker
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Pulumi.Docker
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
4 changes: 2 additions & 2 deletions sdk/dotnet/Pulumi.Docker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RepositoryUrl>https://github.com/pulumi/pulumi-docker</RepositoryUrl>
<PackageIcon>logo.png</PackageIcon>

<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<UseSharedCompilation>false</UseSharedCompilation>
</PropertyGroup>
Expand Down Expand Up @@ -39,7 +39,7 @@
<None Include="version.txt" Pack="True" PackagePath="content" />
</ItemGroup>

<ItemGroup>
<ItemGroup>
<EmbeddedResource Include="pulumi-plugin.json" />
<None Include="pulumi-plugin.json" Pack="True" PackagePath="content" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/RegistryImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Pulumi.Docker
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/dotnet/RemoteImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Pulumi.Docker
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand All @@ -41,6 +42,7 @@ namespace Pulumi.Docker
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
1 change: 1 addition & 0 deletions sdk/dotnet/Volume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Pulumi.Docker
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Docker = Pulumi.Docker;
///
Expand Down
76 changes: 75 additions & 1 deletion sdk/go/docker/image.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 73 additions & 1 deletion sdk/java/src/main/java/com/pulumi/docker/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,22 @@
import javax.annotation.Nullable;

/**
* Builds a Docker Image and pushes to a Docker registry.
* `Image` builds a Docker image and pushes it Docker and OCI compatible registries.
* This resource enables running Docker builds as part of a Pulumi deployment.
*
* Note: This resource does not delete tags, locally or remotely, when destroyed.
*
* ## Cross-platform builds
*
* The Image resource supports cross-platform builds when the [Docker engine has cross-platform support enabled via emulators](https://docs.docker.com/build/building/multi-platform/#building-multi-platform-images).
* The Image resource currently supports providing only a single operating system and architecture in the `platform` field, e.g.: `linux/amd64`.
* To enable this support, you may need to install the emulators in the environment running your Pulumi program.
*
* If you are using Linux, you may be using Docker Engine or Docker Desktop for Linux, depending on how you have installed Docker. The [FAQ for Docker Desktop for Linux](https://docs.docker.com/desktop/faqs/linuxfaqs/#context) describes the differences and how to select which Docker context is in use.
*
* * For local development using Docker Desktop, this is enabled by default.
* * For systems using Docker Engine, install the QEMU binaries and register them with using the docker image from [github.com/tonistiigi/binfmt](https://github.com/tonistiigi/binfmt):
* * In a GitHub Actions workflow, the [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) can be used instead by adding this step to your workflow file. Example workflow usage:
*
* ## Example Usage
* ### A Docker image build
Expand Down Expand Up @@ -55,6 +70,63 @@
* }
* }
* ```
* ### Docker image build using caching with AWS Elastic Container Registry
* ```java
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.ecr.Repository;
* import com.pulumi.aws.ecr.RepositoryArgs;
* import com.pulumi.aws.ecr.EcrFunctions;
* import com.pulumi.aws.ecr.inputs.GetAuthorizationTokenArgs;
* import com.pulumi.docker.Image;
* import com.pulumi.docker.ImageArgs;
* import com.pulumi.docker.inputs.DockerBuildArgs;
* import com.pulumi.docker.inputs.CacheFromArgs;
* import com.pulumi.docker.inputs.RegistryArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var ecrRepository = new Repository(&#34;ecrRepository&#34;, RepositoryArgs.builder()
* .name(&#34;docker-repository&#34;)
* .build());
*
* final var authToken = EcrFunctions.getAuthorizationToken(GetAuthorizationTokenArgs.builder()
* .registryId(ecrRepository.registryId())
* .build());
*
* var myAppImage = new Image(&#34;myAppImage&#34;, ImageArgs.builder()
* .build(DockerBuildArgs.builder()
* .args(Map.of(&#34;BUILDKIT_INLINE_CACHE&#34;, &#34;1&#34;))
* .cacheFrom(CacheFromArgs.builder()
* .images(ecrRepository.repositoryUrl().applyValue(repositoryUrl -&gt; String.format(&#34;%s:latest&#34;, repositoryUrl)))
* .build())
* .context(&#34;app/&#34;)
* .dockerfile(&#34;Dockerfile&#34;)
* .build())
* .imageName(ecrRepository.repositoryUrl().applyValue(repositoryUrl -&gt; String.format(&#34;%s:latest&#34;, repositoryUrl)))
* .registry(RegistryArgs.builder()
* .password(Output.ofSecret(authToken.applyValue(getAuthorizationTokenResult -&gt; getAuthorizationTokenResult).applyValue(authToken -&gt; authToken.applyValue(getAuthorizationTokenResult -&gt; getAuthorizationTokenResult.password()))))
* .server(ecrRepository.repositoryUrl())
* .build())
* .build());
*
* ctx.export(&#34;imageName&#34;, myAppImage.imageName());
* }
* }
* ```
*
*/
@ResourceType(type="docker:index/image:Image")
Expand Down
Loading

0 comments on commit fd3df1c

Please sign in to comment.