@pulumi/docker 4.2.0-alpha.1682376243 → 4.2.0
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.
- package/image.d.ts +46 -1
- package/image.js +46 -1
- package/image.js.map +1 -1
- package/package.json +2 -2
- package/package.json.dev +2 -2
package/image.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import * as pulumi from "@pulumi/pulumi";
|
|
2
2
|
import * as inputs from "./types/input";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* `Image` builds a Docker image and pushes it Docker and OCI compatible registries.
|
|
5
|
+
* This resource enables running Docker builds as part of a Pulumi deployment.
|
|
6
|
+
*
|
|
7
|
+
* Note: This resource does not delete tags, locally or remotely, when destroyed.
|
|
8
|
+
*
|
|
9
|
+
* ## Cross-platform builds
|
|
10
|
+
*
|
|
11
|
+
* 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).
|
|
12
|
+
* The Image resource currently supports providing only a single operating system and architecture in the `platform` field, e.g.: `linux/amd64`.
|
|
13
|
+
* To enable this support, you may need to install the emulators in the environment running your Pulumi program.
|
|
14
|
+
*
|
|
15
|
+
* 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.
|
|
16
|
+
*
|
|
17
|
+
* * For local development using Docker Desktop, this is enabled by default.
|
|
18
|
+
* * 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):
|
|
19
|
+
* * 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:
|
|
5
20
|
*
|
|
6
21
|
* ## Example Usage
|
|
7
22
|
* ### A Docker image build
|
|
@@ -20,6 +35,36 @@ import * as inputs from "./types/input";
|
|
|
20
35
|
* });
|
|
21
36
|
* export const imageName = demoImage.imageName;
|
|
22
37
|
* ```
|
|
38
|
+
* ### Docker image build using caching with AWS Elastic Container Registry
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
42
|
+
* import * as aws from "@pulumi/aws";
|
|
43
|
+
* import * as docker from "@pulumi/docker";
|
|
44
|
+
*
|
|
45
|
+
* const ecrRepository = new aws.ecr.Repository("ecr-repository", {name: "docker-repository"});
|
|
46
|
+
* const authToken = aws.ecr.getAuthorizationTokenOutput({
|
|
47
|
+
* registryId: ecrRepository.registryId,
|
|
48
|
+
* });
|
|
49
|
+
* const myAppImage = new docker.Image("my-app-image", {
|
|
50
|
+
* build: {
|
|
51
|
+
* args: {
|
|
52
|
+
* BUILDKIT_INLINE_CACHE: "1",
|
|
53
|
+
* },
|
|
54
|
+
* cacheFrom: {
|
|
55
|
+
* images: [pulumi.interpolate`${ecrRepository.repositoryUrl}:latest`],
|
|
56
|
+
* },
|
|
57
|
+
* context: "app/",
|
|
58
|
+
* dockerfile: "Dockerfile",
|
|
59
|
+
* },
|
|
60
|
+
* imageName: pulumi.interpolate`${ecrRepository.repositoryUrl}:latest`,
|
|
61
|
+
* registry: {
|
|
62
|
+
* password: pulumi.secret(authToken.password),
|
|
63
|
+
* server: ecrRepository.repositoryUrl,
|
|
64
|
+
* },
|
|
65
|
+
* });
|
|
66
|
+
* export const imageName = myAppImage.imageName;
|
|
67
|
+
* ```
|
|
23
68
|
*/
|
|
24
69
|
export declare class Image extends pulumi.CustomResource {
|
|
25
70
|
/**
|
package/image.js
CHANGED
|
@@ -7,7 +7,22 @@ const pulumi = require("@pulumi/pulumi");
|
|
|
7
7
|
const inputs = require("./types/input");
|
|
8
8
|
const utilities = require("./utilities");
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* `Image` builds a Docker image and pushes it Docker and OCI compatible registries.
|
|
11
|
+
* This resource enables running Docker builds as part of a Pulumi deployment.
|
|
12
|
+
*
|
|
13
|
+
* Note: This resource does not delete tags, locally or remotely, when destroyed.
|
|
14
|
+
*
|
|
15
|
+
* ## Cross-platform builds
|
|
16
|
+
*
|
|
17
|
+
* 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).
|
|
18
|
+
* The Image resource currently supports providing only a single operating system and architecture in the `platform` field, e.g.: `linux/amd64`.
|
|
19
|
+
* To enable this support, you may need to install the emulators in the environment running your Pulumi program.
|
|
20
|
+
*
|
|
21
|
+
* 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.
|
|
22
|
+
*
|
|
23
|
+
* * For local development using Docker Desktop, this is enabled by default.
|
|
24
|
+
* * 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):
|
|
25
|
+
* * 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:
|
|
11
26
|
*
|
|
12
27
|
* ## Example Usage
|
|
13
28
|
* ### A Docker image build
|
|
@@ -26,6 +41,36 @@ const utilities = require("./utilities");
|
|
|
26
41
|
* });
|
|
27
42
|
* export const imageName = demoImage.imageName;
|
|
28
43
|
* ```
|
|
44
|
+
* ### Docker image build using caching with AWS Elastic Container Registry
|
|
45
|
+
*
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
48
|
+
* import * as aws from "@pulumi/aws";
|
|
49
|
+
* import * as docker from "@pulumi/docker";
|
|
50
|
+
*
|
|
51
|
+
* const ecrRepository = new aws.ecr.Repository("ecr-repository", {name: "docker-repository"});
|
|
52
|
+
* const authToken = aws.ecr.getAuthorizationTokenOutput({
|
|
53
|
+
* registryId: ecrRepository.registryId,
|
|
54
|
+
* });
|
|
55
|
+
* const myAppImage = new docker.Image("my-app-image", {
|
|
56
|
+
* build: {
|
|
57
|
+
* args: {
|
|
58
|
+
* BUILDKIT_INLINE_CACHE: "1",
|
|
59
|
+
* },
|
|
60
|
+
* cacheFrom: {
|
|
61
|
+
* images: [pulumi.interpolate`${ecrRepository.repositoryUrl}:latest`],
|
|
62
|
+
* },
|
|
63
|
+
* context: "app/",
|
|
64
|
+
* dockerfile: "Dockerfile",
|
|
65
|
+
* },
|
|
66
|
+
* imageName: pulumi.interpolate`${ecrRepository.repositoryUrl}:latest`,
|
|
67
|
+
* registry: {
|
|
68
|
+
* password: pulumi.secret(authToken.password),
|
|
69
|
+
* server: ecrRepository.repositoryUrl,
|
|
70
|
+
* },
|
|
71
|
+
* });
|
|
72
|
+
* export const imageName = myAppImage.imageName;
|
|
73
|
+
* ```
|
|
29
74
|
*/
|
|
30
75
|
class Image extends pulumi.CustomResource {
|
|
31
76
|
/**
|
package/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../image.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,wCAAwC;AAGxC,yCAAyC;AAEzC
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../image.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,wCAAwC;AAGxC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,MAAa,KAAM,SAAQ,MAAM,CAAC,cAAc;IAC5C;;;;;;;OAOG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,IAAmC;QAC5F,OAAO,IAAI,KA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ulumi/docker",
|
|
3
|
-
"version": "v4.2.0
|
|
3
|
+
"version": "v4.2.0",
|
|
4
4
|
"description": "A Pulumi package for interacting with Docker in Pulumi programs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pulumi",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tsc",
|
|
14
|
-
"install": "node scripts/install-pulumi-plugin.js resource docker v4.2.0
|
|
14
|
+
"install": "node scripts/install-pulumi-plugin.js resource docker v4.2.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@pulumi/pulumi": "^3.0.0",
|
package/package.json.dev
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/docker",
|
|
3
|
-
"version": "v4.2.0
|
|
3
|
+
"version": "v4.2.0",
|
|
4
4
|
"description": "A Pulumi package for interacting with Docker in Pulumi programs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pulumi",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tsc",
|
|
14
|
-
"install": "node scripts/install-pulumi-plugin.js resource docker v4.2.0
|
|
14
|
+
"install": "node scripts/install-pulumi-plugin.js resource docker v4.2.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@pulumi/pulumi": "^3.0.0",
|