Skip to content

Commit f2343ed

Browse files
committed
fix(docker-bake): Prettier fix
1 parent c13e725 commit f2343ed

File tree

4 files changed

+50
-101
lines changed

4 files changed

+50
-101
lines changed

src/schemas/json/docker-bake.json

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333
"type": "object",
3434
"properties": {
3535
"default": {
36-
"type": [
37-
"string",
38-
"null"
39-
]
36+
"type": ["string", "null"]
4037
}
4138
},
4239
"additionalProperties": false
@@ -64,9 +61,7 @@
6461
"type": "string"
6562
}
6663
},
67-
"required": [
68-
"result"
69-
]
64+
"required": ["result"]
7065
}
7166
}
7267
},
@@ -94,9 +89,7 @@
9489
}
9590
}
9691
},
97-
"required": [
98-
"targets"
99-
]
92+
"required": ["targets"]
10093
},
10194
"target": {
10295
"type": "object",
@@ -105,10 +98,7 @@
10598
"description": "Use the args attribute to define build arguments for the target. This has the same effect as passing a --build-arg flag to the build command.\nYou can set args attributes to use null values. Doing so forces the target to use the ARG value specified in the Dockerfile.",
10699
"type": "object",
107100
"additionalProperties": {
108-
"type": [
109-
"string",
110-
"null"
111-
]
101+
"type": ["string", "null"]
112102
}
113103
},
114104
"annotations": {
@@ -178,10 +168,7 @@
178168
"description": "Assigns image labels to the build. This is the same as the --label flag for docker build.\nt's possible to use a null value for labels. If you do, the builder uses the label value specified in the Dockerfile.",
179169
"type": "object",
180170
"additionalProperties": {
181-
"type": [
182-
"string",
183-
"null"
184-
]
171+
"type": ["string", "null"]
185172
}
186173
},
187174
"matrix": {
@@ -232,8 +219,8 @@
232219
}
233220
},
234221
"shm-size": {
235-
"description": "Sets the size of the shared memory allocated for build containers when using RUN instructions.\nThe format is <number><unit>. number must be greater than 0. Unit is optional and can be b (bytes), k (kilobytes), m (megabytes), or g (gigabytes). If you omit the unit, the system uses bytes.\nThis is the same as the --shm-size flag for docker build.",
236-
"$ref": "#/definitions/shmSize"
222+
"$ref": "#/definitions/shmSize",
223+
"description": "Sets the size of the shared memory allocated for build containers when using RUN instructions.\nThe format is <number><unit>. number must be greater than 0. Unit is optional and can be b (bytes), k (kilobytes), m (megabytes), or g (gigabytes). If you omit the unit, the system uses bytes.\nThis is the same as the --shm-size flag for docker build."
237224
},
238225
"ssh": {
239226
"description": "Defines SSH agent sockets or keys to expose to the build. This is the same as the --ssh flag. This can be useful if you need to access private repositories during a build.",

src/test/docker-bake/basic.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
"$schema": "../../schemas/json/docker-bake.json",
33
"group": {
44
"default": {
5-
"targets": [
6-
"webapp"
7-
]
5+
"targets": ["webapp"]
86
}
97
},
108
"target": {
119
"webapp": {
12-
"dockerfile": "Dockerfile.webapp",
13-
"context": "webapp"
10+
"context": "webapp",
11+
"dockerfile": "Dockerfile.webapp"
1412
}
1513
}
1614
}

src/test/docker-bake/complex.json

Lines changed: 27 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,81 +2,54 @@
22
"$schema": "../../schemas/json/docker-bake.json",
33
"group": {
44
"default": {
5-
"targets": [
6-
"frontend", "backend"
7-
]
5+
"targets": ["frontend", "backend"]
86
},
97
"dev": {
10-
"targets": [
11-
"frontend-dev", "backend-dev"
12-
]
8+
"targets": ["frontend-dev", "backend-dev"]
139
}
1410
},
1511
"target": {
12+
"backend": {
13+
"context": "backend",
14+
"dockerfile": "backend/Dockerfile",
15+
"inherits": ["base"]
16+
},
17+
"backend-dev": {
18+
"dockerfile": "backend/Dockerfile-dev",
19+
"inherits": ["backend"]
20+
},
1621
"base": {
17-
"annotations": [
18-
"com.example.key1=value1",
19-
"com.example.key2=value2"
20-
],
22+
"annotations": ["com.example.key1=value1", "com.example.key2=value2"],
2123
"args": {
2224
"ARG1": null
2325
},
24-
"attest": [
25-
"type=sbom"
26-
],
27-
"cache-from": [
28-
"something"
29-
],
30-
"cache-to": [
31-
"something"
32-
],
26+
"attest": ["type=sbom"],
27+
"cache-from": ["something"],
28+
"cache-to": ["something"],
3329
"labels": {
3430
"label1": "value1",
3531
"label2": "value2"
3632
},
3733
"no-cache": true,
38-
"no-cache-filter": [
39-
"type=local,ref=dev"
40-
],
41-
"output": [
42-
"type=oci,dest=frontend.tar"
43-
],
44-
"platforms": [
45-
"linux/amd64"
46-
],
47-
"secret": [
48-
"id=secret1,src=secret1.txt"
49-
],
50-
"shm-size": "1g",
34+
"no-cache-filter": ["type=local,ref=dev"],
35+
"output": ["type=oci,dest=frontend.tar"],
36+
"platforms": ["linux/amd64"],
5137
"pull": true,
52-
"ssh": [
53-
"id=ssh1,src=ssh1.txt"
54-
],
55-
"tags": [
56-
"docker.io/username/frontend:latest"
57-
],
38+
"secret": ["id=secret1,src=secret1.txt"],
39+
"shm-size": "1g",
40+
"ssh": ["id=ssh1,src=ssh1.txt"],
41+
"tags": ["docker.io/username/frontend:latest"],
5842
"target": "build",
59-
"ulimits": [
60-
"nofile=1024:2048"
61-
]
43+
"ulimits": ["nofile=1024:2048"]
6244
},
6345
"frontend": {
64-
"inherits": ["base"],
46+
"context": "frontend",
6547
"dockerfile": "frontend/Dockerfile",
66-
"context": "frontend"
48+
"inherits": ["base"]
6749
},
6850
"frontend-dev": {
69-
"inherits": ["frontend"],
70-
"dockerfile": "frontend/Dockerfile-dev"
71-
},
72-
"backend": {
73-
"inherits": ["base"],
74-
"dockerfile": "backend/Dockerfile",
75-
"context": "backend"
76-
},
77-
"backend-dev": {
78-
"inherits": ["backend"],
79-
"dockerfile": "backend/Dockerfile-dev"
51+
"dockerfile": "frontend/Dockerfile-dev",
52+
"inherits": ["frontend"]
8053
}
8154
}
8255
}
Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
11
{
22
"$schema": "../../schemas/json/docker-bake.json",
3-
"variable": {
4-
"TAG": {
5-
"default": "latest"
3+
"function": {
4+
"increment": {
5+
"params": ["number"],
6+
"result": "${number+1}"
67
}
78
},
89
"group": {
910
"default": {
10-
"targets": [
11-
"webapp-dev"
12-
]
11+
"targets": ["webapp-dev"]
1312
}
1413
},
1514
"target": {
1615
"webapp-dev": {
17-
"annotations": [
18-
"com.example.key1=value1",
19-
"com.example.key2=value2"
20-
],
21-
"attest": [
22-
"type=sbom"
23-
],
24-
"dockerfile": "Dockerfile.webapp",
25-
"tags": [
26-
"docker.io/username/webapp:latest"
27-
],
16+
"annotations": ["com.example.key1=value1", "com.example.key2=value2"],
2817
"args": {
2918
"buildino": "${increment(123)}"
30-
}
19+
},
20+
"attest": ["type=sbom"],
21+
"dockerfile": "Dockerfile.webapp",
22+
"tags": ["docker.io/username/webapp:latest"]
3123
}
3224
},
33-
"function": {
34-
"increment": {
35-
"params": ["number"],
36-
"result": "${number+1}"
25+
"variable": {
26+
"TAG": {
27+
"default": "latest"
3728
}
3829
}
3930
}

0 commit comments

Comments
 (0)