Add --add-host for docker build

Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: 7a962e4577628c357f96153eca07e527813fb42b
Component: engine
This commit is contained in:
Tony Abboud
2017-02-20 17:32:28 -05:00
parent c4ca316177
commit 7dba33b4e7
10 changed files with 77 additions and 5 deletions
@@ -21,6 +21,7 @@ keywords: "API, Docker, rcli, REST, documentation"
* `GET /networks` is optimised only to return list of all networks and network specific information. List of all containers attached to a specific network is removed from this API and is only available using the network specific `GET /networks/{network-id}.
* `GET /containers/json` now supports `publish` and `expose` filters to filter containers that expose or publish certain ports.
* `POST /services/create` and `POST /services/(id or name)/update` now accept the `ReadOnly` parameter, which mounts the container's root filesystem as read only.
* `POST /build` now accepts `extrahosts` parameter to specify a host to ip mapping to use during the build.
## v1.26 API changes
@@ -21,6 +21,7 @@ Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
Options:
--add-host value Add a custom host-to-IP mapping (host:ip) (default [])
--build-arg value Set build-time variables (default [])
--cache-from value Images to consider as cache sources (default [])
--cgroup-parent string Optional parent cgroup for the container
@@ -435,6 +436,13 @@ Linux namespaces. On Microsoft Windows, you can specify these values:
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.
### Add entries to container hosts file (--add-host)
You can add other hosts into a container's `/etc/hosts` file by using one or
more `--add-host` flags. This example adds a static address for a host named
`docker`:
$ docker build --add-host=docker:10.180.0.1 .
### Squash an image's layers (--squash) **Experimental Only**
@@ -451,3 +459,4 @@ space.
**Note**: using this option you may see significantly more space used due to
storing two copies of the image, one for the build cache with all the cache
layers in tact, and one for the squashed version.