Skip to content

Remove unnecessary Dockerfile syntax directive#7141

Merged
lbussell merged 3 commits intodotnet:nightlyfrom
lbussell:docker-syntax
Apr 10, 2026
Merged

Remove unnecessary Dockerfile syntax directive#7141
lbussell merged 3 commits intodotnet:nightlyfrom
lbussell:docker-syntax

Conversation

@lbussell
Copy link
Copy Markdown
Member

BuildKit is the default builder since Docker/Moby 23.0, and imagebuilder runs using moby-engine 25.0.3 on Azure Linux 3.0. The syntax directive is no longer needed. Removing it avoids pulling a remote image under network isolation. This is intended to fix build errors in build#2948160:

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 254B done
#1 DONE 0.0s

#2 resolve image config for docker.io/docker/dockerfile:1
#2 ERROR: failed to do request: Head "[https://registry-1.docker.io/v2/docker/dockerfile/manifests/1"](https://registry-1.docker.io/v2/docker/dockerfile/manifests/1%22): dial tcp 192.0.2.32:443: i/o timeout
------
 > resolve image config for docker.io/docker/dockerfile:1:
------
Dockerfile:1
--------------------
   1 | >>> # syntax=docker/dockerfile:1
   2 |     ARG REPO=mcr.microsoft.com/dotnet/sdk
   3 |     FROM $REPO:10.0.201-azurelinux3.0-amd64
--------------------

…ckerfiles

BuildKit is the default builder since Docker/Moby 23.0, and imagebuilder
runs moby-engine 25.0.3 on Azure Linux 3.0. The syntax directive is no
longer needed. Removing it avoids pulling a remote image under network
isolation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lbussell lbussell requested a review from a team April 10, 2026 16:39
@lbussell lbussell requested a review from a team as a code owner April 10, 2026 16:39
lbussell and others added 2 commits April 10, 2026 09:40
This template is not referenced in manifest.json and produces no generated
Dockerfiles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lbussell lbussell enabled auto-merge (squash) April 10, 2026 17:29
@lbussell
Copy link
Copy Markdown
Member Author

/backport to release/2026-04B

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/2026-04B (link to workflow run)

@lbussell lbussell merged commit d4acb98 into dotnet:nightly Apr 10, 2026
125 checks passed
@lbussell lbussell deleted the docker-syntax branch April 10, 2026 18:27
@github-actions github-actions bot added the needs-backport PR that should be backported to another branch label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-backport PR that should be backported to another branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants