Merge pull request #4166 from ChrisChinchilla/chrisward/network-context

Add networking reference link
This commit is contained in:
Sebastiaan van Stijn 2023-12-21 00:51:23 +01:00 committed by GitHub
commit dd3ba7396d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -29,7 +29,7 @@ Build an image from a Dockerfile
| `--label` | `list` | | Set metadata for an image | | `--label` | `list` | | Set metadata for an image |
| `-m`, `--memory` | `bytes` | `0` | Memory limit | | `-m`, `--memory` | `bytes` | `0` | Memory limit |
| `--memory-swap` | `bytes` | `0` | Swap limit equal to memory plus swap: -1 to enable unlimited swap | | `--memory-swap` | `bytes` | `0` | Swap limit equal to memory plus swap: -1 to enable unlimited swap |
| `--network` | `string` | `default` | Set the networking mode for the RUN instructions during build | | [`--network`](#network) | `string` | `default` | Set the networking mode for the RUN instructions during build |
| `--no-cache` | | | Do not use cache when building the image | | `--no-cache` | | | Do not use cache when building the image |
| `--platform` | `string` | | Set platform if server is multi-platform capable | | `--platform` | `string` | | Set platform if server is multi-platform capable |
| `--pull` | | | Always attempt to pull a newer version of the image | | `--pull` | | | Always attempt to pull a newer version of the image |
@ -630,6 +630,18 @@ On another machine:
$ docker build --cache-from myname/myapp . $ docker build --cache-from myname/myapp .
``` ```
### <a name="network"></a> Set the networking mode for the RUN instructions during build (--network)
#### Overview
Available options for the networking mode are:
- `default` (default): Run in the default network.
- `none`: Run with no network access.
- `host`: Run in the hosts network environment.
Find more details in the [Dockerfile documentation](https://docs.docker.com/engine/reference/builder/#run---network).
### <a name="squash"></a> Squash an image's layers (--squash) (experimental) ### <a name="squash"></a> Squash an image's layers (--squash) (experimental)
#### Overview #### Overview