Skip to content

Commit 5cc3278

Browse files
committed
feat(nx-docker): add load and push optiions to build executor
1 parent 70ee863 commit 5cc3278

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

packages/nx-docker/src/executors/build/executor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const prepareDockerArguments = (
5252
['-t', `${registry}/${options.namespace}:${tag.replace(/{major}/g, version.major.toString()).replace(/{minor}/g, version.minor.toString()).replace(/{patch}/g, version.patch.toString())}`]
5353
)
5454
).flat() || [];
55+
const loadArgs = options.load ? ['--load'] : [];
56+
const pushArgs = options.push ? ['--push'] : [];
5557

5658
return [
5759
...outputArgs,
@@ -69,6 +71,8 @@ const prepareDockerArguments = (
6971
...tagsArgs,
7072
...targetArgs,
7173
...labelsArgs,
74+
...loadArgs,
75+
...pushArgs,
7276
'-f',
7377
dockerfilePath,
7478
contextPath,

packages/nx-docker/src/executors/build/schema.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ export interface DockerExecutorSchema {
1919
registries: Array<string>;
2020
version?: string;
2121
namespace?: string;
22+
load: boolean;
23+
push: boolean;
2224
}

packages/nx-docker/src/executors/build/schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@
4343
"type": "string",
4444
"description": "Namespace and name for the devcontainer image in the registry"
4545
},
46+
"load": {
47+
"type": "boolean",
48+
"description": "Load the image into the docker daemon",
49+
"default": false
50+
},
51+
"push": {
52+
"type": "boolean",
53+
"description": "Push the image to the registry",
54+
"default": false
55+
},
4656
"tags": {
4757
"type": "array",
4858
"items": {

0 commit comments

Comments
 (0)