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
Copy file name to clipboardExpand all lines: content/manuals/build/building/best-practices.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -259,8 +259,8 @@ to create an efficient and maintainable Dockerfile.
259
259
260
260
> [!TIP]
261
261
>
262
-
> Want a better editing experience for Dockerfiles in VS Code?
263
-
> Check out the [Docker VS Code Extension (Beta)](https://marketplace.visualstudio.com/items?itemName=docker.docker) for linting, code navigation, and vulnerability scanning.
262
+
> To improve linting, code navigation, and vulnerability scanning of your Dockerfiles in Visual Studio Code
263
+
> see [Docker VS Code Extension](https://marketplace.visualstudio.com/items?itemName=docker.docker).
264
264
265
265
### FROM
266
266
@@ -487,7 +487,7 @@ service, such as Apache and Rails, you would run something like `CMD
487
487
for any service-based image.
488
488
489
489
In most other cases, `CMD` should be given an interactive shell, such as bash,
490
-
python and perl. For example, `CMD ["perl", "-de0"]`, `CMD ["python"]`, or `CMD
490
+
Python and perl. For example, `CMD ["perl", "-de0"]`, `CMD ["python"]`, or `CMD
491
491
["php", "-a"]`. Using this form means that when you execute something like
492
492
`docker run -it python`, you’ll get dropped into a usable shell, ready to go.
493
493
`CMD` should rarely be used in the manner of `CMD ["param", "param"]` in
@@ -556,7 +556,7 @@ $ docker run --rm test sh -c 'echo $ADMIN_USER'
556
556
mark
557
557
```
558
558
559
-
To prevent this, and really unset the environment variable, use a `RUN` command
559
+
To prevent this and unset the environment variable, use a `RUN` command
560
560
with shell commands, to set, use, and unset the variable all in a single layer.
561
561
You can separate your commands with `;` or `&&`. If you use the second method,
562
562
and one of the commands fails, the `docker build` also fails. This is usually a
Copy file name to clipboardExpand all lines: content/manuals/build/checks.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,8 +38,8 @@ Build checks are useful for:
38
38
39
39
> [!TIP]
40
40
>
41
-
> Want a better editing experience for Dockerfiles in VS Code?
42
-
> Check out the [Docker VS Code Extension (Beta)](https://marketplace.visualstudio.com/items?itemName=docker.docker) for linting, code navigation, and vulnerability scanning.
41
+
> To improve linting, code navigation, and vulnerability scanning of your Dockerfiles in Visual Studio Code
42
+
> see [Docker VS Code Extension](https://marketplace.visualstudio.com/items?itemName=docker.docker).
Copy file name to clipboardExpand all lines: content/manuals/build/ci/github-actions/cache.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ jobs:
37
37
38
38
- name: Set up Docker Buildx
39
39
uses: docker/setup-buildx-action@v3
40
-
40
+
41
41
- name: Build and push
42
42
uses: docker/build-push-action@v6
43
43
with:
@@ -67,10 +67,10 @@ jobs:
67
67
with:
68
68
username: ${{ vars.DOCKERHUB_USERNAME }}
69
69
password: ${{ secrets.DOCKERHUB_TOKEN }}
70
-
70
+
71
71
- name: Set up Docker Buildx
72
72
uses: docker/setup-buildx-action@v3
73
-
73
+
74
74
- name: Build and push
75
75
uses: docker/build-push-action@v6
76
76
with:
@@ -108,10 +108,10 @@ jobs:
108
108
with:
109
109
username: ${{ vars.DOCKERHUB_USERNAME }}
110
110
password: ${{ secrets.DOCKERHUB_TOKEN }}
111
-
111
+
112
112
- name: Set up Docker Buildx
113
113
uses: docker/setup-buildx-action@v3
114
-
114
+
115
115
- name: Build and push
116
116
uses: docker/build-push-action@v6
117
117
with:
@@ -124,47 +124,47 @@ jobs:
124
124
> [!IMPORTANT]
125
125
>
126
126
> Starting [April 15th, 2025, only GitHub Cache service API v2 will be supported](https://gh.io/gha-cache-sunset).
127
-
>
127
+
>
128
128
> If you encounter the following error during your build:
129
-
>
129
+
>
130
130
> ```console
131
131
> ERROR: failed to solve: This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP. For more information: https://gh.io/gha-cache-sunset
132
132
> ```
133
-
>
133
+
>
134
134
> You're probably using outdated tools that only support the legacy GitHub
135
135
> Cache service API v1. Here are the minimum versions you need to upgrade to
136
136
> depending on your use case:
137
137
> * Docker Buildx >= v0.21.0
138
138
> * BuildKit >= v0.20.0
139
139
> * Docker Compose >= v2.33.1
140
140
> * Docker Engine >= v28.0.0 (if you're building using the Docker driver with containerd image store enabled)
141
-
>
141
+
>
142
142
> If you're building using the `docker/build-push-action` or `docker/bake-action`
143
143
> actions on GitHub hosted runners, Docker Buildx and BuildKit are already up
144
144
> to date but on self-hosted runners, you may need to update them yourself.
145
145
> Alternatively, you can use the `docker/setup-buildx-action` action to install
146
146
> the latest version of Docker Buildx:
147
-
>
147
+
>
148
148
> ```yaml
149
149
> - name: Set up Docker Buildx
150
150
> uses: docker/setup-buildx-action@v3
151
151
> with:
152
152
> version: latest
153
153
> ```
154
-
>
154
+
>
155
155
> If you're building using Docker Compose, you can use the
156
156
> `docker/setup-compose-action` action:
157
-
>
157
+
>
158
158
> ```yaml
159
159
> - name: Set up Docker Compose
160
160
> uses: docker/setup-compose-action@v1
161
161
> with:
162
162
> version: latest
163
163
> ```
164
-
>
164
+
>
165
165
> If you're building using the Docker Engine with the containerd image store
166
166
> enabled, you can use the `docker/setup-docker-action` action:
167
-
>
167
+
>
168
168
> ```yaml
169
169
> -
170
170
> name: Set up Docker
@@ -182,7 +182,7 @@ jobs:
182
182
### Cache mounts
183
183
184
184
BuildKit doesn't preserve cache mounts in the GitHub Actions cache by default.
185
-
If you wish to put your cache mounts into GitHub Actions cache and reuse it
185
+
To put your cache mounts into GitHub Actions cache and reuse it
186
186
between builds, you can use a workaround provided by
Copy file name to clipboardExpand all lines: content/manuals/build/concepts/context.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -498,6 +498,7 @@ The following code snippet shows an example `.dockerignore` file.
498
498
*/*/temp*
499
499
temp?
500
500
```
501
+
<!-- vale off -->
501
502
502
503
This file causes the following build behavior:
503
504
@@ -508,6 +509,8 @@ This file causes the following build behavior:
508
509
|`*/*/temp*`| Exclude files and directories starting with `temp` from any subdirectory that is two levels below the root. For example, `/somedir/subdir/temporary.txt` is excluded. |
509
510
|`temp?`| Exclude files and directories in the root directory whose names are a one-character extension of `temp`. For example, `/tempa` and `/tempb` are excluded. |
0 commit comments