Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Remove other examples
Browse files Browse the repository at this point in the history
  • Loading branch information
blampe committed Apr 20, 2024
1 parent e947041 commit f3aad64
Showing 1 changed file with 0 additions and 370 deletions.
370 changes: 0 additions & 370 deletions themes/default/content/blog/docker-build/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,376 +462,6 @@ image in downstream Pulumi resources like ECS
or Kubernetes
[Deployments](https://www.pulumi.com/registry/packages/kubernetes/api-docs/apps/v1/deployment/).

<!---
### Example: Multi-platform image
{{% choosable language typescript %}}
```typescript
import * as docker_build from "@pulumi/docker-build";
const image = new docker_build.Image("image", {
context: {
location: "app",
},
platforms: [
docker_build.Platform.Linux_amd64,
docker_build.Platform.Linux_arm64,
],
});
```
{{% /choosable %}}
{{% choosable language python %}}
```python
import pulumi_docker_build as docker_build
image = docker_build.Image("image",
context=docker_build.BuildContextArgs(
location="app",
),
platforms=[
docker_build.Platform.LINUX_AMD64,
docker_build.Platform.LINUX_ARM64,
])
```
{{% /choosable %}}
{{% choosable language csharp %}}
```csharp
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DockerBuild = Pulumi.DockerBuild;
return await Deployment.RunAsync(() =>
{
var image = new DockerBuild.Image("image", new()
{
Context = new DockerBuild.Inputs.BuildContextArgs
{
Location = "app",
},
Platforms = new[]
{
DockerBuild.Platform.Linux_amd64,
DockerBuild.Platform.Linux_arm64,
},
});
});
```
{{% /choosable %}}
{{% choosable language go %}}
```go
package main
import (
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
Context: &dockerbuild.BuildContextArgs{
Location: pulumi.String("app"),
},
Platforms: docker - build.PlatformArray{
dockerbuild.Platform_Linux_amd64,
dockerbuild.Platform_Linux_arm64,
},
})
if err != nil {
return err
}
return nil
})
}
```
{{% /choosable %}}
{{% choosable language yaml %}}
```yaml
description: Multi-platform image
name: multi-platform
resources:
image:
properties:
context:
location: app
platforms:
- linux/amd64
- linux/arm64
type: docker-build:Image
runtime: yaml
```
{{% /choosable %}}
{{% choosable language java %}}
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dockerbuild.Image;
import com.pulumi.dockerbuild.ImageArgs;
import com.pulumi.dockerbuild.inputs.BuildContextArgs;
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 image = new Image("image", ImageArgs.builder()
.context(BuildContextArgs.builder()
.location("app")
.build())
.platforms(
"linux/amd64",
"linux/arm64")
.build());
}
}
```
{{% /choosable %}}
### Example: Registry caching
{{% choosable language typescript %}}
```typescript
import * as pulumi from "@pulumi/pulumi";
import * as docker_build from "@pulumi/docker-build";
const image = new docker_build.Image("image", {
cacheFrom: [{
local: {
src: "tmp/cache",
},
}],
cacheTo: [{
local: {
dest: "tmp/cache",
mode: docker_build.CacheMode.Max,
},
}],
context: {
location: "app",
},
});
```
{{% /choosable %}}
{{% choosable language python %}}
```python
import pulumi
import pulumi_docker_build as docker_build
image = docker_build.Image("image",
cache_from=[docker_build.CacheFromArgs(
local=docker_build.CacheFromLocalArgs(
src="tmp/cache",
),
)],
cache_to=[docker_build.CacheToArgs(
local=docker_build.CacheToLocalArgs(
dest="tmp/cache",
mode=docker_build.CacheMode.MAX,
),
)],
context=docker_build.BuildContextArgs(
location="app",
))
```
{{% /choosable %}}
{{% choosable language csharp %}}
```csharp
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DockerBuild = Pulumi.DockerBuild;
return await Deployment.RunAsync(() =>
{
var image = new DockerBuild.Image("image", new()
{
CacheFrom = new[]
{
new DockerBuild.Inputs.CacheFromArgs
{
Local = new DockerBuild.Inputs.CacheFromLocalArgs
{
Src = "tmp/cache",
},
},
},
CacheTo = new[]
{
new DockerBuild.Inputs.CacheToArgs
{
Local = new DockerBuild.Inputs.CacheToLocalArgs
{
Dest = "tmp/cache",
Mode = DockerBuild.CacheMode.Max,
},
},
},
Context = new DockerBuild.Inputs.BuildContextArgs
{
Location = "app",
},
});
});
```
{{% /choosable %}}
{{% choosable language go %}}
```go
package main
import (
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
CacheFrom: dockerbuild.CacheFromArray{
&dockerbuild.CacheFromArgs{
Local: &dockerbuild.CacheFromLocalArgs{
Src: pulumi.String("tmp/cache"),
},
},
},
CacheTo: dockerbuild.CacheToArray{
&dockerbuild.CacheToArgs{
Local: &dockerbuild.CacheToLocalArgs{
Dest: pulumi.String("tmp/cache"),
Mode: dockerbuild.CacheModeMax,
},
},
},
Context: &dockerbuild.BuildContextArgs{
Location: pulumi.String("app"),
},
})
if err != nil {
return err
}
return nil
})
}
```
{{% /choosable %}}
{{% choosable language yaml %}}
```yaml
description: Caching
name: caching
resources:
image:
properties:
cacheFrom:
- local:
src: tmp/cache
cacheTo:
- local:
dest: tmp/cache
mode: max
context:
location: app
type: docker-build:Image
runtime: yaml
```
{{% /choosable %}}
{{% choosable language java %}}
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dockerbuild.Image;
import com.pulumi.dockerbuild.ImageArgs;
import com.pulumi.dockerbuild.inputs.CacheFromArgs;
import com.pulumi.dockerbuild.inputs.CacheFromLocalArgs;
import com.pulumi.dockerbuild.inputs.CacheToArgs;
import com.pulumi.dockerbuild.inputs.CacheToLocalArgs;
import com.pulumi.dockerbuild.inputs.BuildContextArgs;
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 image = new Image("image", ImageArgs.builder()
.cacheFrom(CacheFromArgs.builder()
.local(CacheFromLocalArgs.builder()
.src("tmp/cache")
.build())
.build())
.cacheTo(CacheToArgs.builder()
.local(CacheToLocalArgs.builder()
.dest("tmp/cache")
.mode("max")
.build())
.build())
.context(BuildContextArgs.builder()
.location("app")
.build())
.build());
}
}
```
{{% /choosable %}}
--->

## Why a new provider?

The [Pulumi Docker] provider was first introduced in 2018 and has seen wide
Expand Down

0 comments on commit f3aad64

Please sign in to comment.