Skip to content

Commit a340ee9

Browse files
Update common Docker engineering infrastructure with latest
1 parent 34f0be3 commit a340ee9

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

eng/docker-tools/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ All breaking changes and new features in `eng/docker-tools` will be documented i
44

55
---
66

7+
## 2026-04-02: Extra Docker build options can be passed through ImageBuilder
8+
9+
- Pull request: [#2063](https://github.com/dotnet/docker-tools/pull/2063)
10+
11+
ImageBuilder's `build` command now accepts repeated `--build-option` arguments and forwards them directly to
12+
`docker build`. This allows repos to pass options such as `--ulimit nofile=65536:65536` or `--network host`
13+
through `imageBuilderBuildArgs`, in addition to standard Dockerfile `--build-arg` values.
14+
15+
**How to use:**
16+
17+
```yaml
18+
customBuildInitSteps:
19+
- powershell: |
20+
$args = '--build-option "--ulimit nofile=65536:65536"'
21+
echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$args"
22+
```
23+
24+
Repeat `--build-option` for multiple Docker arguments, and quote values that contain spaces.
25+
26+
---
27+
728
## 2026-03-25: Manifest list creation moved to Post_Build
829

930
- Issue: [#2002](https://github.com/dotnet/docker-tools/issues/2002)

eng/docker-tools/DEV-GUIDE.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ To force a rebuild regardless of cache state, set the `noCache` parameter to `tr
370370

371371
### Pattern: Adding Build Arguments
372372

373-
Pass additional arguments to Docker builds via ImageBuilder:
373+
Pass Dockerfile `ARG` values via ImageBuilder:
374374

375375
```yaml
376376
customBuildInitSteps:
@@ -379,6 +379,15 @@ customBuildInitSteps:
379379
echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$args"
380380
```
381381

382+
To pass raw options directly to `docker build`, use `--build-option`. Quote values that contain spaces:
383+
384+
```yaml
385+
customBuildInitSteps:
386+
- powershell: |
387+
$args = '--build-option "--ulimit nofile=65536:65536"'
388+
echo "##vso[task.setvariable variable=imageBuilderBuildArgs]$args"
389+
```
390+
382391
### Pattern: Re-running Stages with `stages` and `sourceBuildPipelineRunId`
383392

384393
A powerful pattern is combining the `stages` variable with the `sourceBuildPipelineRunId` pipeline parameter to run specific stages using artifacts from a previous build. This is useful for:

eng/docker-tools/templates/variables/docker-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables:
2-
imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2941471
2+
imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2947258
33
imageNames.imageBuilder: $(imageNames.imageBuilderName)
44
imageNames.imageBuilder.withrepo: imagebuilder-withrepo:$(Build.BuildId)-$(System.JobId)
55
imageNames.testRunner: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux3.0-docker-testrunner

0 commit comments

Comments
 (0)