Add --add-host for docker build

Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
This commit is contained in:
Tony Abboud 2017-01-13 10:01:58 -05:00 committed by Tibor Vass
parent 09b2383b91
commit 174d9f0097
2 changed files with 16 additions and 0 deletions

View File

@ -21,6 +21,7 @@ Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile Build an image from a Dockerfile
Options: Options:
--add-host value Add a custom host-to-IP mapping (host:ip) (default [])
--build-arg value Set build-time variables (default []) --build-arg value Set build-time variables (default [])
--cache-from value Images to consider as cache sources (default []) --cache-from value Images to consider as cache sources (default [])
--cgroup-parent string Optional parent cgroup for the container --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"`. 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** ### 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 **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 storing two copies of the image, one for the build cache with all the cache
layers in tact, and one for the squashed version. layers in tact, and one for the squashed version.

View File

@ -6,6 +6,7 @@ docker-build - Build an image from a Dockerfile
# SYNOPSIS # SYNOPSIS
**docker build** **docker build**
[**--add-host**[=*[]*]]
[**--build-arg**[=*[]*]] [**--build-arg**[=*[]*]]
[**--cpu-shares**[=*0*]] [**--cpu-shares**[=*0*]]
[**--cgroup-parent**[=*CGROUP-PARENT*]] [**--cgroup-parent**[=*CGROUP-PARENT*]]
@ -74,6 +75,12 @@ set as the **URL**, the repository is cloned locally and then sent as the contex
storing two copies of the image, one for the build cache with all the cache storing two copies of the image, one for the build cache with all the cache
layers in tact, and one for the squashed version. layers in tact, and one for the squashed version.
**--add-host**=[]
Add a custom host-to-IP mapping (host:ip)
Add a line to /etc/hosts. The format is hostname:ip. The **--add-host**
option can be set multiple times.
**--build-arg**=*variable* **--build-arg**=*variable*
name and value of a **buildarg**. name and value of a **buildarg**.