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

Commit

Permalink
Add code sample showing cache from and platform args
Browse files Browse the repository at this point in the history
  • Loading branch information
guineveresaenger committed Mar 7, 2023
1 parent b3a03db commit f029ea8
Showing 1 changed file with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,26 @@ To improve the efficiency of the Docker Provider, we have changed the default be

### BuildKit support

The enhanced functionality and performance provided by the [Docker BuildKit](https://docs.docker.com/build/buildkit/) is now fully available to be leveraged in your Pulumi programs. BuildKit comes with functionality to improve your builds’ performance and the reusability of your Dockerfiles. Cross-platform builds are now supported, enabling image building for a target container runtime that is different from the build environment. BuildKit is now the default builder version mode. The V1 builder can still be accessed by specifying `Build.BuilderVersion=V1`.

<!-- Add image or code snippet for buildkit options or cross platform builds-->
The enhanced functionality and performance provided by the [Docker BuildKit](https://docs.docker.com/build/buildkit/) is now fully available to be leveraged in your Pulumi programs. BuildKit comes with functionality to improve your builds’ performance and the reusability of your Dockerfiles. Cross-platform builds are now supported, enabling image building for a target container runtime that is different from the build environment. BuildKit is now the default builder version mode. The V1 builder can still be accessed by specifying `Build.BuilderVersion=BuilderV1`.

```typescript
import * as docker from "@pulumi/docker";
const img = new docker.Image("my-image", {
imageName: "docker.io/pulumibot/demo-image:latest",
build: {
context: "app",
dockerfile: "Dockerfile",
args: {
"BUILDKIT_INLINE_CACHE": "1"
},
builderVersion: "BuilderBuildKit", // can also be set to `BuilderV1`
cacheFrom: {
images: ["docker.io/pulumibot/demo-image:cache-base"]
},
platform: "linux/amd64",
}
});
```

## Rich Docker build logs inside Pulumi IaC

Expand Down

0 comments on commit f029ea8

Please sign in to comment.