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
@@ -221,7 +219,6 @@ Uses a preconfigured Azure DevOps Docker registry service connection to authenti
221
219
> [!TIP]
222
220
> Learn more: [Use service connections for Docker Hub](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops#docker-hub-or-others)
223
221
224
-
225
222
#### Step 4.3 Build the Docker Image
226
223
227
224
```yaml
@@ -267,29 +264,24 @@ This builds the image with:
267
264
tags: |
268
265
$(buildTag)
269
266
$(latestTag)
270
-
271
267
```
268
+
272
269
By applying this condition, the pipeline builds the Docker image on every run to ensure early detection of issues, but only pushes the image to the registry when changes are merged into the main branch—keeping your Docker Hub clean and focused
273
270
274
271
This uploads both tags to Docker Hub:
275
272
- `$(buildTag)`ensures traceability per run.
276
273
- `latest`is used for most recent image references.
277
-
-
278
-
279
274
280
275
#### Step 4.5 Logout from Docker (Self-Hosted Agents)
0 commit comments