This commit updates documentation and change log to include
the preliminary validation of the dockerfile before instructions
in dockerfile is run one-by-one.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
... | ... |
@@ -123,6 +123,7 @@ This section lists each version from latest to oldest. Each listing includes a |
123 | 123 |
* `POST /containers/create/` and `POST /containers/(name)/update` now validates restart policies. |
124 | 124 |
* `POST /containers/create` now validates IPAMConfig in NetworkingConfig, and returns error for invalid IPv4 and IPv6 addresses (`--ip` and `--ip6` in `docker create/run`). |
125 | 125 |
* `POST /containers/create` now takes a `Mounts` field in `HostConfig` which replaces `Binds` and `Volumes`. *note*: `Binds` and `Volumes` are still available but are exclusive with `Mounts` |
126 |
+* `POST /build` now performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. Note that this change is _unversioned_ and applied to all API versions. |
|
126 | 127 |
|
127 | 128 |
### v1.24 API changes |
128 | 129 |
|
... | ... |
@@ -1201,6 +1201,10 @@ The archive may include any number of other files, |
1201 | 1201 |
which are accessible in the build context (See the [*ADD build |
1202 | 1202 |
command*](../../reference/builder.md#add)). |
1203 | 1203 |
|
1204 |
+The Docker daemon performs a preliminary validation of the `Dockerfile` before |
|
1205 |
+starting the build, and returns an error if the syntax is incorrect. After that, |
|
1206 |
+each instruction is run one-by-one until the ID of the new image is output. |
|
1207 |
+ |
|
1204 | 1208 |
The build is canceled if the client drops the connection by quitting |
1205 | 1209 |
or being killed. |
1206 | 1210 |
|
... | ... |
@@ -1243,6 +1243,10 @@ The archive may include any number of other files, |
1243 | 1243 |
which are accessible in the build context (See the [*ADD build |
1244 | 1244 |
command*](../../reference/builder.md#add)). |
1245 | 1245 |
|
1246 |
+The Docker daemon performs a preliminary validation of the `Dockerfile` before |
|
1247 |
+starting the build, and returns an error if the syntax is incorrect. After that, |
|
1248 |
+each instruction is run one-by-one until the ID of the new image is output. |
|
1249 |
+ |
|
1246 | 1250 |
The build is canceled if the client drops the connection by quitting |
1247 | 1251 |
or being killed. |
1248 | 1252 |
|
... | ... |
@@ -1370,6 +1370,10 @@ The archive may include any number of other files, |
1370 | 1370 |
which are accessible in the build context (See the [*ADD build |
1371 | 1371 |
command*](../../reference/builder.md#add)). |
1372 | 1372 |
|
1373 |
+The Docker daemon performs a preliminary validation of the `Dockerfile` before |
|
1374 |
+starting the build, and returns an error if the syntax is incorrect. After that, |
|
1375 |
+each instruction is run one-by-one until the ID of the new image is output. |
|
1376 |
+ |
|
1373 | 1377 |
The build is canceled if the client drops the connection by quitting |
1374 | 1378 |
or being killed. |
1375 | 1379 |
|
... | ... |
@@ -1448,6 +1448,10 @@ The archive may include any number of other files, |
1448 | 1448 |
which are accessible in the build context (See the [*ADD build |
1449 | 1449 |
command*](../../reference/builder.md#add)). |
1450 | 1450 |
|
1451 |
+The Docker daemon performs a preliminary validation of the `Dockerfile` before |
|
1452 |
+starting the build, and returns an error if the syntax is incorrect. After that, |
|
1453 |
+each instruction is run one-by-one until the ID of the new image is output. |
|
1454 |
+ |
|
1451 | 1455 |
The build is canceled if the client drops the connection by quitting |
1452 | 1456 |
or being killed. |
1453 | 1457 |
|
... | ... |
@@ -1625,6 +1625,10 @@ The archive may include any number of other files, |
1625 | 1625 |
which are accessible in the build context (See the [*ADD build |
1626 | 1626 |
command*](../../reference/builder.md#add)). |
1627 | 1627 |
|
1628 |
+The Docker daemon performs a preliminary validation of the `Dockerfile` before |
|
1629 |
+starting the build, and returns an error if the syntax is incorrect. After that, |
|
1630 |
+each instruction is run one-by-one until the ID of the new image is output. |
|
1631 |
+ |
|
1628 | 1632 |
The build is canceled if the client drops the connection by quitting |
1629 | 1633 |
or being killed. |
1630 | 1634 |
|
... | ... |
@@ -1658,6 +1658,10 @@ The archive may include any number of other files, |
1658 | 1658 |
which are accessible in the build context (See the [*ADD build |
1659 | 1659 |
command*](../../reference/builder.md#add)). |
1660 | 1660 |
|
1661 |
+The Docker daemon performs a preliminary validation of the `Dockerfile` before |
|
1662 |
+starting the build, and returns an error if the syntax is incorrect. After that, |
|
1663 |
+each instruction is run one-by-one until the ID of the new image is output. |
|
1664 |
+ |
|
1661 | 1665 |
The build is canceled if the client drops the connection by quitting |
1662 | 1666 |
or being killed. |
1663 | 1667 |
|
... | ... |
@@ -1661,6 +1661,10 @@ The archive may include any number of other files, |
1661 | 1661 |
which are accessible in the build context (See the [*ADD build |
1662 | 1662 |
command*](../../reference/builder.md#add)). |
1663 | 1663 |
|
1664 |
+The Docker daemon performs a preliminary validation of the `Dockerfile` before |
|
1665 |
+starting the build, and returns an error if the syntax is incorrect. After that, |
|
1666 |
+each instruction is run one-by-one until the ID of the new image is output. |
|
1667 |
+ |
|
1664 | 1668 |
The build is canceled if the client drops the connection by quitting |
1665 | 1669 |
or being killed. |
1666 | 1670 |
|
... | ... |
@@ -1682,6 +1682,10 @@ The archive may include any number of other files, |
1682 | 1682 |
which are accessible in the build context (See the [*ADD build |
1683 | 1683 |
command*](../../reference/builder.md#add)). |
1684 | 1684 |
|
1685 |
+The Docker daemon performs a preliminary validation of the `Dockerfile` before |
|
1686 |
+starting the build, and returns an error if the syntax is incorrect. After that, |
|
1687 |
+each instruction is run one-by-one until the ID of the new image is output. |
|
1688 |
+ |
|
1685 | 1689 |
The build is canceled if the client drops the connection by quitting |
1686 | 1690 |
or being killed. |
1687 | 1691 |
|
... | ... |
@@ -68,6 +68,13 @@ add multiple `-t` parameters when you run the `build` command: |
68 | 68 |
|
69 | 69 |
$ docker build -t shykes/myapp:1.0.2 -t shykes/myapp:latest . |
70 | 70 |
|
71 |
+Before the Docker daemon runs the instructions in the `Dockerfile`, it performs |
|
72 |
+a preliminary validation of the `Dockerfile` and returns an error if the syntax is incorrect: |
|
73 |
+ |
|
74 |
+ $ docker build -t test/myapp . |
|
75 |
+ Sending build context to Docker daemon 2.048 kB |
|
76 |
+ Error response from daemon: Unknown instruction: RUNCMD |
|
77 |
+ |
|
71 | 78 |
The Docker daemon runs the instructions in the `Dockerfile` one-by-one, |
72 | 79 |
committing the result of each instruction |
73 | 80 |
to a new image if necessary, before finally outputting the ID of your |