You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
The [`docker build`](commandline/build.md) command builds an image from
31
+
The [docker build](commandline/build.md) command builds an image from
32
32
a `Dockerfile` and a *context*. The build's context is the set of files at a
33
33
specified location `PATH` or `URL`. The `PATH` is a directory on your local
34
34
filesystem. The `URL` is a Git repository location.
@@ -93,8 +93,7 @@ instructions.
93
93
Whenever possible, Docker will re-use the intermediate images (cache),
94
94
to accelerate the `docker build` process significantly. This is indicated by
95
95
the `Using cache` message in the console output.
96
-
(For more information, see the [Build cache section](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#build-cache) in the
97
-
`Dockerfile` best practices guide):
96
+
(For more information, see the [`Dockerfile` best practices guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/):
98
97
99
98
$ docker build -t svendowideit/ambassador .
100
99
Sending build context to Docker daemon 15.36 kB
@@ -137,7 +136,7 @@ implementation. For example, BuildKit can:
137
136
* Avoid side-effects with rest of the API (intermediate images and containers)
138
137
* Prioritize your build cache for automatic pruning
139
138
140
-
To use the BuildKit backend, you need to set an environment variable
139
+
To use the BuildKit backend, you need to set an environment variable
141
140
`DOCKER_BUILDKIT=1` on the CLI before invoking `docker build`.
142
141
143
142
To learn about the experimental Dockerfile syntax available to BuildKit-based
@@ -269,7 +268,7 @@ This feature is only enabled if the [BuildKit](#buildkit) backend is used.
269
268
270
269
The syntax directive defines the location of the Dockerfile builder that is used for
271
270
building the current Dockerfile. The BuildKit backend allows to seamlessly use
272
-
external implementations of builders that are distributed as Docker images and
271
+
external implementations of builders that are distributed as Docker images and
273
272
execute inside a container sandbox environment.
274
273
275
274
Custom Dockerfile implementation allows you to:
@@ -280,9 +279,9 @@ Custom Dockerfile implementation allows you to:
280
279
281
280
### Official releases
282
281
283
-
Docker distributes official versions of the images that can be used for building
284
-
Dockerfiles under `docker/dockerfile` repository on Docker Hub. There are two
285
-
channels where new images are released: stable and experimental.
282
+
Docker distributes official versions of the images that can be used for building
283
+
Dockerfiles under `docker/dockerfile` repository on Docker Hub. There are two
284
+
channels where new images are released: stable and experimental.
286
285
287
286
Stable channel follows semantic versioning. For example:
288
287
@@ -298,9 +297,9 @@ component from the stable channel on the time of the release. For example:
298
297
- docker/dockerfile:1.0-experimental - latest experimental releases after 1.0
299
298
- docker/dockerfile:experimental - latest release on experimental channel
300
299
301
-
You should choose a channel that best fits your needs. If you only want
300
+
You should choose a channel that best fits your needs. If you only want
302
301
bugfixes, you should use `docker/dockerfile:1.0`. If you want to benefit from
303
-
experimental features, you should use the experimental channel. If you are using
302
+
experimental features, you should use the experimental channel. If you are using
304
303
the experimental channel, newer releases may not be backwards compatible, so it
305
304
is recommended to use an immutable full version variant.
306
305
@@ -571,7 +570,7 @@ Or
571
570
FROM [--platform=<platform>] <image>[@<digest>] [AS <name>]
572
571
573
572
The `FROM` instruction initializes a new build stage and sets the
574
-
[*Base Image*](glossary.md#base-image) for subsequent instructions. As such, a
573
+
[*Base Image*](../../glossary/#base-image) for subsequent instructions. As such, a
575
574
valid `Dockerfile` must start with a `FROM` instruction. The image can be
576
575
any valid image – it is especially easy to start by **pulling an image** from
577
576
the [*Public Repositories*](https://docs.docker.com/engine/tutorials/dockerrepos/).
@@ -694,7 +693,7 @@ cache for `RUN` instructions can be invalidated by using the `--no-cache`
694
693
flag, for example `docker build --no-cache`.
695
694
696
695
See the [`Dockerfile` Best Practices
697
-
guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/build-cache) for more information.
696
+
guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/) for more information.
698
697
699
698
The cache for `RUN` instructions can be invalidated by `ADD` instructions. See
700
699
[below](#add) for details.
@@ -1015,7 +1014,7 @@ of whether or not the file has changed and the cache should be updated.
1015
1014
> following instructions from the Dockerfile if the contents of `<src>` have
1016
1015
> changed. This includes invalidating the cache for `RUN` instructions.
1017
1016
> See the [`Dockerfile` Best Practices
1018
-
guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/build-cache) for more information.
1017
+
guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/) for more information.
1019
1018
1020
1019
1021
1020
`ADD` obeys the following rules:
@@ -1436,7 +1435,7 @@ containers. The value can be a JSON array, `VOLUME ["/var/log/"]`, or a plain
1436
1435
string with multiple arguments, such as `VOLUME /var/log` or `VOLUME /var/log
1437
1436
/var/db`. For more information/examples and mounting instructions via the
1438
1437
Docker client, refer to
1439
-
[*Share Directories via Volumes*](https://docs.docker.com/engine/tutorials/dockervolumes/#/mount-a-host-directory-as-a-data-volume)
1438
+
[*Share Directories via Volumes*](https://docs.docker.com/engine/tutorials/dockervolumes/)
1440
1439
documentation.
1441
1440
1442
1441
The `docker run` command initializes the newly created volume with any data
@@ -2055,13 +2054,12 @@ The `SHELL` feature was added in Docker 1.12.
2055
2054
This feature is only available when using the [BuildKit](#buildkit) backend.
2056
2055
2057
2056
Docker build supports experimental features like cache mounts, build secrets and
2058
-
ssh forwarding that are enabled by using an external implementation of the
2057
+
ssh forwarding that are enabled by using an external implementation of the
2059
2058
builder with a syntax directive. To learn about these features, [refer to the documentation in BuildKit repository](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/experimental.md).
2060
2059
2061
2060
## Dockerfile examples
2062
2061
2063
-
Below you can see some examples of Dockerfile syntax. If you're interested in
2064
-
something more realistic, take a look at the list of [Dockerization examples](https://docs.docker.com/engine/examples/).
2062
+
Below you can see some examples of Dockerfile syntax.
0 commit comments